https://github.com/lianbinghua

随笔分类 -  angular

摘要:Example - example-example34-production 姓名: name不能为空 name最大长度6 手机号: phone不能为空 手机号格式不正... 阅读全文
posted @ 2015-09-24 10:43 连冰华 阅读(446) 评论(0) 推荐(0)
摘要:姓名 手机号 姓名不能为空 姓名不少于2字符 姓名不大于6... 阅读全文
posted @ 2015-09-23 18:30 连冰华 阅读(421) 评论(0) 推荐(0)
摘要:Before compilation? – ControllerAfter compilation? – Linkvar app = angular.module('plunker', []);app.controller('MainCtrl', function($scope) { $scope... 阅读全文
posted @ 2015-09-23 11:29 连冰华 阅读(257) 评论(0) 推荐(0)
摘要:Hello Lorem ipsum dolor sit amet World Mauris elementum elementum enim at suscipit. counter: {{i || 0}} angular.module('docsTab... 阅读全文
posted @ 2015-09-23 10:15 连冰华 阅读(147) 评论(0) 推荐(0)
摘要:angular.module('docsIsolateScopeDirective', []).controller('Controller', ['$scope', function($scope) { $scope.naomi="aaa";}]).directive('myCustom... 阅读全文
posted @ 2015-09-22 17:57 连冰华 阅读(658) 评论(0) 推荐(0)
摘要:functionlink(scope,element,attrs){...}where:scopeis an Angular scope object.elementis the jqLite-wrapped element that this directive matches.attrsis a... 阅读全文
posted @ 2015-09-22 16:04 连冰华 阅读(413) 评论(0) 推荐(0)
摘要:$scope.setCookie=function(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays)... 阅读全文
posted @ 2015-09-22 15:49 连冰华 阅读(111) 评论(0) 推荐(0)
摘要:$scope.countdown = 10;var myTime = setInterval(function() { $scope.countdown--; $scope... 阅读全文
posted @ 2015-09-22 15:28 连冰华 阅读(582) 评论(0) 推荐(0)
摘要:$watch是一个scope函数,用于监听模型变化,当你的模型部分发生变化时它会通知你。$watch(watchExpression, listener, objectEquality);每个参数的说明如下:watchExpression:监听的对象,它可以是一个angular表达式如'name',... 阅读全文
posted @ 2015-09-22 11:13 连冰华 阅读(293) 评论(0) 推荐(0)
摘要:Template-expanding directive: angular.module('docsSimpleDirective', []).controller('Controller', ['$scope', function($scope) { $scope.customer = { ... 阅读全文
posted @ 2015-09-22 09:35 连冰华 阅读(226) 评论(0) 推荐(0)
摘要:依赖注入 依赖注入(DI)是一个经典的设计模式, 主要是用来处理组件如何获得依赖的问题。关于DI,推荐阅读Martin Flower的文章(http://martinfowler.com/articles/injection.html)。 Angular负责创建组件,解决它们之间的依赖关系,并按要求... 阅读全文
posted @ 2015-09-17 18:03 连冰华 阅读(1271) 评论(0) 推荐(0)
摘要:方法1:写filter deliciousApp.filter('html', ['$sce', function ($sce) { return function (text) { return $sce.trustAsHtml(text); }; }]);方... 阅读全文
posted @ 2015-09-17 17:27 连冰华 阅读(1051) 评论(0) 推荐(0)