directive

it2022-05-05  91

directive var myModule = angular.module(...); myModule.directive('directiveName', function factory(injectables) { var directiveDefinitionObject = {   priority: 0, //指令优先级   template: '<div></div>', //函数(返回值必须是字符串)或者字符串   templateUrl: 'directive.html', //路径   replace: false, //是否替换标签   transclude: false, //是否被模板替换   restrict: 'A', //取值类型,E(元素),A(属性),C(类),M(注释),可以共用如:'EA'   scope: false, //作用域   compile: function compile(tElement, tAttrs, transclude) {     return {       pre: function preLink(scope, iElement, iAttrs, controller) { ... },       post: function postLink(scope, iElement, iAttrs, controller) { ... }     }   },   link: function postLink(scope, iElement, iAttrs) { ... } }; return directiveDefinitionObject; });

  

posted on 2019-04-01 20:59 苏清 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/YaChing/p/10638899.html

相关资源:DIRECTIVE 2011 65 EU ROHS.pdf

最新回复(0)