随笔分类 - angular讲解
摘要:1, AngularJS四大特性 (1)MVC模型 (2)双向数据绑定 (3)DI(依赖注入) (4)模块化编程 一,声明,ng的作用范围: 2,Angular表达式 提示:angular表达式的本质是一段JS代码,先调用eval()执行出式子的值,再输出在当前位置上。 {{ 式子 }} 总结: (1){{}}可以输出各种数学/比较/逻辑/三目运算/调用string对象的方法/模型变量的值;...
阅读全文
摘要:1.在“伪页面跳转”时“页面”间传递数据 声明带参数的路由地址: $routeProvider.when('/xxx/:路由参数名', {templateUrl: 'tpl/xxx.html',controller: 'xxxCtrl'})========================页面跳转时...
阅读全文
摘要:若JS文件被压缩了,形参名会被简化为类似a、b、c的名称,会导致Angular无法根据形参进行注入!解决方法: .controller('控制器名', ['$scope','$http','$interval',function(a, b, c){ a.ename='Tom'; b...
阅读全文
摘要:若声明数据使用:$rootScope.名称 = 值; 也是模型数据,可以使用{{}}、ngBind进行数据绑定,且可以在多个Controller之间共享。
阅读全文
摘要:Angular模块组件——过滤器 number过滤器 {{1234567890.123456}} {{1234567890.123456 | number :2}} {{1234567890.123456 | number : 4}} currency过滤器 {{1234...
阅读全文
摘要:四大特性之二:双向数据绑定 是否同意注册条款 用户名: 用户名: 我同意本站的使用条款{{agree}}...
阅读全文
摘要:angular.module('APP', ['ng']).controller('wat_form',function($scope){ $scope.price=18; $scope.num=10; $scope.$watch('price',function(){ ...
阅读全文
摘要:.slide-in-up.ng-enter, .slide-in-up > .ng-enter { -webkit-transition: all cubic-bezier(.1, .7, .1, 1) 400ms; transition: all cubic-bezier(.1, .7, .1,
阅读全文

浙公网安备 33010602011771号