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

浙公网安备 33010602011771号