I have a json object and I need to loop through the json and display the value to the model. the keys of the json is same with the ng-model values. I was able to get the key and values.. I only need to pass it to the inputs..
below is my code.
controller.js
var supplierStorage = {"key1":"value1", "key2":"value2", "key3":"value3"};
for (var i = 0; i <= Object.keys(supplierStorage).length-1; i++) {
$scope.Object.keys(supplierStorage)[i] = supplierStorage.Object.keys(supplierStorage)[i];
}
HTML
<input ng-model="key1">
<input ng-model="key2">
<input ng-model="key3">
Thanks.
$scope.Object.keys?