AngularJS-translation
AngularJS-translation copied to clipboard
Chinese translation of book AngularJS by Brad Green & Shyam Sesbadri
``` javascript app.directive('myBlur',['$parse',function($parse){ return { link: function(scope,element,attr){ var exprFn = $parse(attr.jqmBlur); element.bind('blur',function(e){ scope.$apply(function(){ exprFn(scope,{$element:element,$event:e}); }); }); } }; }]) ```
``` html {{name}} ``` following code will not work ``` html {{name}} ```
[How to surround text with tag conditionally in AngularJS?](http://stackoverflow.com/questions/16579597/how-to-surround-text-with-tag-conditionally-in-angularjs/16579695?noredirect=1#comment23826942_16579695) ``` html linked notlinked ``` credit [Umur Kontacı](http://stackoverflow.com/users/825780/umur-kontaci)
``` html "all" %> //disable jqm routing $(document).bind('mobileinit', function(){ $.extend( $.mobile , { linkBindingEnabled: false, hashListeningEnabled:false }); } ); /* show page by default */ .ui-mobile [data-role=page]{ display:block; } ```...
[Call a function when ng-repeat has finished](http://stackoverflow.com/questions/15207788/calling-a-function-when-ng-repeat-has-finished) ``` javascript var module = angular.module('testApp', []) .directive('onFinishRender', function ($timeout) { return { restrict: 'A', link: function (scope, element, attr) { if (scope.$last...
初学 AngularJS,发现两个错误: - 第一次出现的 `$scope.needed = $scope.startingEstimate * 10;` 两个属性应该都引用自 `$scope.funding` ——这个例子比较奇怪,前后不一致,没有进行解释,然后在后面出现的例子又有不是从 funding 引用的。 - `ng-class='selected: $index==selectedRow'` 应该是 `ng-class="{selected: $index==selectedRow}"`
[Internet Explorer Compatibility](http://docs.angularjs.org/guide/ie)
原文地址 [AngularJS - Conceptual Overview](http://docs.angularjs.org/guide/concepts) 本文简介Angular的主要组件和其工作原理: # 启动阶段  (以下面的Hello World为例) - 浏览器加载HTML,解析之,建立DOM - 浏览器加载angular.js - Angular等待 DOMContentLoaded事件触发 - Angular查找定义了程序边界的ng-app指令 - 用ng-app中指定的模块配置$injector - 用$injector配置$compile服务和$rootScope - 用$compile服务编译DOM并与$rootScope建立关系 - ng-init指令设置scope的name属性为'World' - {{name}}被替换为name属性的值,形成'Hello...