码迷,mamicode.com
首页 > 其他好文 > 详细

ng-Directive

时间:2016-09-26 18:04:48      阅读:96      评论:0      收藏:0      [点我收藏+]

标签:

伪代码:

  

var myModule = angular.module(...);
myModule.directive(‘namespaceDirectiveName‘, function factory(injectables) {
var directiveDefinitionObject = {
restrict: string,
priority: number,
template: string,
templateUrl: string,
replace: bool,
transclude: bool,
scope: bool or object,
controller: function controllerConstructor($scope,
$element,
$attrs,
$transclude),
require: string,
link: function postLink(scope, iElement, iAttrs) { ... },
compile: function compile(tElement, tAttrs, transclude) {
return {
pre: function preLink(scope, iElement, iAttrs, controller) { ... },
post: function postLink(scope, iElement, iAttrs, controller) { ... }
}
}
};
return directiveDefinitionObject;
});

  

ng-Directive

标签:

原文地址:http://www.cnblogs.com/goodearth/p/5909951.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!