I have a scenario where I have to loop through the JSON string in template. I tried these 2 solutions but none of them are working properly: 1. Create a filter and pass it to ng-init:
< div ng-init="var1 = (COL_FIELD | FormatJson)">
<span ng-repeat="wut_detail in var1.wu_tester_detail"> {{wut_detail}}</span> </div>
Above filter converts the string to JSON object properly, but ng-init seems to be working abnormally it doesn't refreshes data properly on search.
Can anyone please help, how I can change the variable COL_FIELD to JSON object in the template without using ng-init.
$scopethen itterate through it with ng-repeat. check this topic for some reference [stackoverflow.com/questions/21697695/…COL_FIELDjson value to a Scope variable?? Are you sure browser hanged that time??$httprequest and save the result to$scopevariable, i assume that after i read stackoverflow.com/questions/34300193/… and docs.angularjs.org/api/ng/directive/ngInit.