
angularJs
文章平均质量分 74
丧心病狂大丧失
唯自律者得自由
展开
-
ngResource模块的使用
ngResource模块是angular专门为RESTful架构而设计的一个模块,它提供了'$resource'模块,$resource模块是基于$http的一个封装.下面来看看它的详细用法1.引入angular-resource.min.js文件2.在模块中依赖ngResourece,在服务中注入$resourcevar HttpREST = angular.mo转载 2016-07-30 10:39:12 · 867 阅读 · 0 评论 -
AngularJs自定义指令
除了 AngularJS 内置的指令外,我们还可以创建自定义指令。你可以使用 .directive 函数来添加自定义的指令。要调用自定义指令,HTML 元素上需要添加自定义指令名。使用驼峰法来命名一个指令, runoobDirective, 但在使用它时需要以 - 分割, runoob-directive:AngularJS 实例body ng-app=转载 2016-08-04 16:03:10 · 605 阅读 · 0 评论 -
修改angular post提交json数据的格式_ $httpProvider配置
修改angular post提交默认格式是json数据的格式,我们如果想用$_Post接收数据的话,那么就得配置$httpProvider$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';$httpProvider.defaults.headers.put[转载 2016-08-04 18:20:41 · 3764 阅读 · 0 评论 -
AngulaJS路由 ui-router 传递多个参数
angular中使用routeParams传递参数.在app.js中写法 when( ‘/online_show_list/:video_type/:factory/’, { templateUrl: ‘statics/partials/online_show_list.html’, controlle转载 2016-08-13 11:30:46 · 6357 阅读 · 0 评论