首页 > Web开发 > 详细

[AngularJS] Decorator a directive

时间:2020-01-20 20:56:19      阅读:66      评论:0      收藏:0      [点我收藏+]
use strict

    .config(function config($provide) {
        $provide.decorator(ndTrackClickDirective, function diective($delegate) {
            /**@ngInject */
            
            $delegate[0].compile = function() {
                // create a new link function
                return function(scope, el, attr) {
                    
                   /* Your code here*/
                };
            };

            // remove the old link function
            delete $delegate[0].link;

            return $delegate;
        });
    });

 

[AngularJS] Decorator a directive

原文:https://www.cnblogs.com/Answer1215/p/12219312.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!