Angularjs: how to pass scope variables to a directive?

前端 未结 3 462
误落风尘
误落风尘 2021-02-01 17:19

I am trying to use directive to create and append several tags to a

as shown below:

module.directive(\'createControl\', function(){
  re         


        
3条回答
  •  旧时难觅i
    2021-02-01 17:46

        app.directive('createControl', function() {
          return {
            scope: {
              createControl:'='
            },
            link: function(scope, element, attrs){    
               element.text(scope.createControl);    
            }      
          }
        })  
    
      

提交回复
热议问题