I use angularjs to create a pagination type, for example, I have a 2D array and I am showing values โโfrom it. It works fine, but I also want to be able to edit the values, so I used ng-hide in the input tag and it works fine, but the problem is that if the input type is a number or date, and the value type of my array is a string then values โโare not displayed in editable inputs.
the code:
<table class="table table-hover"> <thead> <tr class="active"> <th class="id">Label</th> <th class="name">Field</th> </tr> </thead> <tbody> <tr ng-repeat="item in fieldsonPage[currentPage]" class="active"> <td>{{item}}</td> <td> <div ng-repeat="prop in pagedItems[currentPage]" class="active"> <div ng-hide="ngEditName" ng-click="ngEditName=!ngEditName"> {{prop[item]}} </div> <div ng-show="ngEditName"> <input type="{{fieldsType[item]}}" ng-hide="{{fieldsType[item] == 'textarea' ? 'true' : 'false'}}" ng-model="prop[item]" class="form-control"/> <textarea rows="4" cols="50" ng-hide="{{fieldsType[item] == 'textarea' ? 'false' : 'true'}}" class="form-control" ng-model="prop[item]" /><div ng-click="ngEditName=!ngEditName">Close</div> </div> </div> </td> </tr> </tbody> </table>
The type is determined by the type of related data that works, but the binding is not correct, so I need a way to convert the string to a number or date into an expression in the html page itself . Any key! 
source share