【文件属性】:
文件名称:angular-fancy-url:$http.get('api
文件大小:10KB
文件格式:ZIP
更新时间:2021-07-13 16:03:49
JavaScript
角度花式网址
( )
做就是了
app . service ( 'myService' , function ( $http ) {
// GET http://api.example.com/users
return $http . get ( 'api://users' ) ;
} ) ;
不再
app . service ( 'myService' , function ( $http , apiUrl ) {
// GET http://api.example.com/users
return $http . get ( apiUrl + '/users' ) ;
} ) ;
灵活性——拦截器为赢!
可读性——没有额外的字符串连接或辅助调用
“可测试性”
用法
bower install angular-fancy-url --save
然后
angu
【文件预览】:
angular-fancy-url-master
----.jshintrc(394B)
----.gitattributes(11B)
----bower.json(300B)
----Gruntfile.js(3KB)
----lib()
--------fancyUrl.js(685B)
----.travis.yml(110B)
----example()
--------index.html(1KB)
----LICENSE(1KB)
----test()
--------.jshintrc(631B)
--------spec()
--------runner.html(225B)
----README.md(1022B)
----dist()
--------angular-fancy-url.min.js(369B)
--------angular-fancy-url.js(678B)
----.editorconfig(415B)
----.gitignore(35B)
----karma.conf.js(1KB)
----package.json(932B)