AngularJS ng-repeat directive, created dynamically does not work -
I tried to add ng-repeat instructions in the compilation method, but this is not work.
Here's a demo:
I was hoping that 'field' instructions are useful in three fields (input) but this is not happening
here's my The code is:
html:
& lt; Div ng-app = 'myApp' ng-controller = 'testCtrl' & gt; {{Object.var}} & lt; Field value = 'object.var' plural & gt; & Lt; / Field & gt; & Lt; / Div & gt;
JS:
app.controller ('testCtrl', function ($ scope) {$ scope.object = { Var: [1, 2, 3]}}); The app 'directive' ('field', function ($ paras) {returns} {restriction: 'AE', scope: {value: '='}, template: " , link: function () {}}}) app.directive ('plural', function ($ compilation) {return} {priority} : 1001, compiled: function (element, atri) {Element.attr ({'ng-repeat': 'track by $ index in eye object', 'value': 'object.var [$ index]', 'button ':' '});}}})
Multiplying at the end of the compiled function Not directed
return function (field element) {$ Compilation (Elementkcontents ()) (scope); }
Comments
Post a Comment