码迷,mamicode.com
首页 > Web开发 > 详细

AngularJS -- Directive参数

时间:2016-05-16 12:31:42      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:

angular.module(‘myApp‘, []) 
.directive(‘myDirective‘, function() { 
    return { 
        restrict: String, 
        priority: Number, 
        terminal: Boolean, 
        template: String or Template Function: 
      function(tElement, tAttrs) {...}, 
      templateUrl: String, 
      replace: Boolean or String, 
      scope: Boolean or Object, 
      transclude: Boolean, 
      controller: String or 
      function(scope, element, attrs, transclude, otherInjectables) { ... }, 
      controllerAs: String, 
      require: String, 
      link: function(scope, iElement, iAttrs) { ... }, 
      compile: // 返回一个对象或连接函数,如下所示:
      function(tElement, tAttrs, transclude) { 
          return { 
              pre: function(scope, iElement, iAttrs, controller) { ... }, 
              post: function(scope, iElement, iAttrs, controller) { ... } 
             } 
          return function postLink(...) { ... } 
        } 
    }; 
 });

AngularJS -- Directive参数

标签:

原文地址:http://www.cnblogs.com/lianfu/p/5497515.html

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