angular, in directive, adding to the template an element with ng model

后端 未结 2 1158
慢半拍i
慢半拍i 2021-02-15 09:55

I\'m trying to add an input element with ng-model inside a directive.

my code

the link function of my directive:

link: function (scope, element,          


        
2条回答
  •  眼角桃花
    2021-02-15 10:09

    Try

    var a_input = angular.element($compile('')($scope))
    elem_0.append(a_input);
    

提交回复
热议问题