I have the following array of objects, which is a server response. I am trying to use ng-repeat to iterate over this array and read each value.
While trying to use in html, array[0].value is working while using ng-repeat, nothing is working.
After a lot of debugging, I am unable to understand how ng-repeat is working for arrays.
Here is my example:
messages array:
[
{"Id":14,"Text":"hii hello","count":750},
{"Id":10009,"Text":"test message","count":6}
]
The following is used in html:
<div class="my-message" layout="row" layout-align="center center">
{{messages}} <!-- printing the above array -->
<div ng-repat="message in messages">
{{ message.Id}}<!-- printing nothing -->
</div>
{{ messages[0].Id }} <!-- printing 14 !-->
</div>
The array is in scope and it is also seen in this html as the {{ message }} array is printing properly.
Can someone help me understand the working of ng-repeat and where am I missing
ng-repat(should beng-repeat)?