Model binding is not working when creating different type inputs dynamically with AngularJs ng-repeat -


please @ code @ plunker http://plnkr.co/edit/tzi0xm if input type fixed (all text or checkbox...), there's no problem, data binding working, if defined input type dynamically, second input binding doesn't work, please me.

<ul>     <li ng-repeat="prop in currentnode.props">         {{prop.name}}<input ng-model="prop.value" type="{{prop.type}}"></input>     </li> </ul> 

ok here html

<li ng-repeat="prop in currentnode.props">         {{prop.name}}<input ng-model="prop.value" checked="{{prop.value}}" type="{{prop.type}}"></input>     </li> 

and controller code

var app = angular.module('plunker', []);  app.controller('mainctrl', function($scope) {   $scope.currentnode = {name:'cube',                         props:[                           {name:'displayname',value:'new cube',type:'text'},                           {name:'visible',value:'checked',type:'checkbox'}                         ]}; }); 

and here plunk http://plnkr.co/edit/zy5lh9

hope helps :)


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -