Dynamic Directive Element Fails In Pre Populate Data From Service
Found some solution to create dynamic fields by directive using object.Also can able to create dynamic directive var app = angular.module('app', []); app.directive('field', functi
Solution 1:
What do you expect it to display? in your Ctrl1 controller you define such a dynamic template:
html: '<div ng-repeat="elem in t.elements"><field id="elem.id" fieldData="elem.id" label="elem.label" template="elem.template_name" placeholder="elem.placeholder"></field></div>'
Mind the fieldData="elem.id" attribute. Your field directive is displaying value provided via fielddata attribute. And you do provide element's id for it.
Post a Comment for "Dynamic Directive Element Fails In Pre Populate Data From Service"