var appModule = angular.module('app', []);
appModule.directive('hello',["$scope","custom", function($scope,custom) {
return {
restrict: 'E',
template: 'Hi there
',
replace: true
};
});
var appModule = angular.module('app', []);
appModule.directive('hello',["$scope","custom", function($scope,custom) {
return {
restrict: 'E',
template: 'Hi there
',
replace: true
};
});
var appModule = angular.module('app', [$scope","custom"]);
这分别是 指令注入,控制器注入,模块中注入,那么在angular 中注入的区别是什么?为什么要分这么多中类型?!
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
a.directive("expender",["$scope",function($scope){
}])
但是指令这样写会报错?!