首页 > 代码库 > angularjs 笔记

angularjs 笔记


控制台调试
angular.element($0).scope() $0~$4
angular.element($("#controllerId")).scope()

 

依赖注入
angualar.module(‘myModule‘, []).
config([‘depProvider‘, function(depProvider){
...
}]).
factory(‘serviceId‘, [‘depService‘, function(depService) {
...
}]).
directive(‘directiveName‘, [‘depService‘, function(depService) {
...
}]).
filter(‘filterName‘, [‘depService‘, function(depService) {
...
}]).
run([‘depService‘, function(depService) {
...
}]);

angularjs 笔记