今天还是来说一下angular中的路由模块。我们实际项目中,各个页面的切换是经常会与Auth相关的。比如我网站的后台,是需要登录过的用户才能进去,那么我们用angularJS做前端路由的时候应该怎么完成这个功能呢--------------------------------------------...
分类:
Web程序 时间:
2015-05-22 11:28:55
阅读次数:
261
如果我们像往常一样使用jq中的$.ajax方法,那代码应该是: ? $.ajax({ ? ? ? ? ? ? method:‘post‘, ? ? ? ? ? ? url:‘url.jsp‘, ? ? ? ? ? ? data:{ ? ? ? ? ? ? ? ?name:$(‘#id‘).v...
分类:
Web程序 时间:
2015-05-22 00:41:12
阅读次数:
1077
$scope 的使用贯穿整个 Angular App 应用,它与数据模型相关联,同时也是表达式执行的上下文.有了 $scope 就在视图和控制器之间建立了一个通道,基于作用域视图在修改数据时会立刻更新 $scope,同样的 $scope 发生改变时也会立刻重新渲染视图.有了 $scope 这样一个桥...
分类:
其他好文 时间:
2015-05-22 00:20:32
阅读次数:
126
1、expander.html: 单击展开demo {{text}} 2、expander.js:var myModule = angular.module("app",[]);myModule.directive('expander',function(){ return { re...
分类:
Web程序 时间:
2015-05-21 19:27:05
阅读次数:
218
加入新公司,前端要求用angularjs,渣渣表示虽然熟悉angular但是运用起来才发现一切都不一样, angularjs写但页面非常方面,整个贯穿directives和controllers,service里面的内容就是一个$scope, 所以新手要注意...
分类:
Web程序 时间:
2015-05-21 12:57:03
阅读次数:
164
1、httpBasic.html: $http与后台数据交互 {{user.name}} 2、httpBasic.js:var myModule = angular.module("app",[]);myModule.controller('loadDataCtrl', ['$...
分类:
Web程序 时间:
2015-05-21 12:22:10
阅读次数:
162
Extending types is one of the ways that makes angular-formly help you keep your Angular forms DRY. When use responsibly, they can make it much easier ...
分类:
Web程序 时间:
2015-05-21 06:33:37
阅读次数:
142
Understanding Controllers (控制器) In Angular, a Controller is a JavaScript constructor function that is used to augment the Angular Scope.When a Control...
分类:
其他好文 时间:
2015-05-20 23:57:08
阅读次数:
148
ConceptualOverviewTemplate(模板):HTMLwithadditionalmarkup(就是增加了新的标记的HTML)Directive(指令):extendHTMLwithcustomattributesandelements(给HTML增加自定义属性和元素)Model(模...
分类:
其他好文 时间:
2015-05-20 23:45:48
阅读次数:
158
1、index.html: scopeEqual 控制器中的内容: 指令中的内容: 2、scopeEqual.js:var myModule = angular.module("app",[]);myModule.controller('myCtrl', ['$scope', functi...
分类:
Web程序 时间:
2015-05-20 13:05:56
阅读次数:
127