I am using angularjs to make a pagination type of thing, say I have a 2D array and I am displaying the values from it. Its working fine but I also want to be able to edit thoes values so I used ng-hide in input tag and its working fine but the problem is that if the type of input is number or date and the type of my array values is string then the values are not displayed in the editable input boxes.
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 decided on the kind of data associated which is working but the binding is not proper so i need a way to convert string to number or date in the expression in html page itself. Any clue!!
