-
1.3版本以上不支持直接 定义 function 的写法, 转换的写法为: angular.module('myapp', []).controller('myCtrl', function($scope){})
-
1.3版本以上不支持 html 中不定义 ng-app 的写法, 所以在页面中是必须要定义ng-app="myApp"的.并且你的 js 代码中要 angular.module('myapp', [])这样才可以.
-
在 angular 中, 如果你在使用 ng-repeat 指令, 那么你的数据里面是不能存在相同的值的, 如果确实想要相同的值可以在 ng-repeat 的后面加上 track by $index | ng-repeat="iterm in iterms track by $index" 可以解决这类的问题.
-
指令的规范化
AngularJS在进行匹配检测之前,首先对HTML元素的标签和属性名转化成规范的驼峰式字符串:去除名称前缀的x-和data-以: , - 或 _ 为分割符,将字符串切分成单词,除第一个单词外,其余单词首字母大写重新拼接各单词
例如,下面的写法都等效地匹配ngBind指令:
<span ng:bind="name"></span>
<span ng_bind="name"></span>
<span data-ng-bind="name"></span>
<span x-ng-bind="name"></span>
5. angular 函数使用:
//将json字符串转换为json对象 angular.fromJson()
//对象合并 angular.extend()
6.angular 中的使用 provider 定义的服务是不可以使用 angular 提供的内置指令的, 比如使用:
.provider('formLayout', ['$http', function($http){...}])此时angular 是会报错的。
如果要用到的话可以在$get:function($http){...}中注入。
8.angular 五种服务详解 http://www.cnblogs.com/liulangmao/p/4078246.html