概要
这是将并包装为AngularJS模块的实现。
程式码范例
将rHttpSnippet模块注入到Angular应用中,这样就可以注入httpSnippet工厂。
angular . module ( 'myapp' , [ 'rHttpSnippet' ] )
. controller ( 'myController' , function ( 'httpSnippet' ) {
// create the HAR request configuration
var confHAR = {
"method" : "GET" ,
"url" : "http://example.com/v1/contacts/"
} ;
// get a new instance of httpSnippet
var mySnippet = httpSnip