How to call a method defined in an AngularJS directive?

前端 未结 13 1069
萌比男神i
萌比男神i 2020-11-22 14:39

I have a directive, here is the code :

.directive(\'map\', function() {
    return {
        restrict: \'E\',
        replace: true,
        template: \'<         


        
13条回答
  •  悲哀的现实
    2020-11-22 15:24

    TESTED Hope this helps someone.

    My simple approach (Think tags as your original code)

    
    
    callfunction:"=callfunction" link : function(scope,element,attr) { scope.callfunction = function() { /// your code } }

提交回复
热议问题