Als...">

Elements are missing in ng-repeat

Suppose I have this in HTML

<div ng-repeat="tag in response.Tags | filter : searchKey">
</div>

      

Also I have a text input with a model searchKey

.

<input type="text" ng-model="searchKey">

      

response.Tags

is a JSON array.

Now the problem is that the UI is populated ng-repeat

with some missing objects loaded by default. When I use text input and filters the list, I see the missing things.

Something went wrong?

Note - there are no changes in the array. The elements are there. After loading it, it hasn't changed.

Edit This is the raw data I am getting. Could go up to 500 items, nothing missed when there were only a few left.

    {
"AlertCategoryID": 15,
"AlertName": "Disk Space Low",
"AlertType": "Warning",
"AlertMessage": "<data><summary>Available disk space (%) on drive _Total is less than 10%. Current value is 5%.</summary><detail></detail></data>",
"AlertTime": "2015-05-21T19:24:03"
    }, {
"AlertCategoryID": 15,
"AlertName": "Disk Space Low",
"AlertType": "Warning",
"AlertMessage": "<data><summary>Available disk space (%) on drive _Total is less than 10%. Current value is 5%.</summary><detail></detail></data>",
"AlertTime": "2015-05-21T19:22:05"
}

      

I am using an XML parser to extract the tag <summary>

, also I intercept and remove the T between date and time; and assign them to an array that I will use for ng-repeat.

I am showing AlertName, Message and its time in the UI.

I noticed that those elements that tend to get lost have very large XML in the post tag. I don't know if this is related to anything.

+3


source to share


1 answer


If you want to filter based on a specific key in a JSON object use the following syntax



<div ng-repeat="tag in response.Tags | filter:{ AlertName: searchKey }">

      

+1


source







All Articles