Home AngularJs displaying ng-repeat data with some conditions
Reply: 0

AngularJs displaying ng-repeat data with some conditions

user583
1#
user583 Published in June 21, 2018, 8:41 am

This is my JSON object response:

{
"senderdata": "123456789",
"senderName": "ifelse",
"message": "Hi",
"draftName": "empty"
}

I am displaying this in UI using ng-repeat:

I am getting this json response in $scope.drafts.

my code:

tr(ng-repeat='draft in drafts')
 td {{draft.draftName}}
 td {{draft.senderName}}
 td {{draft.message}}

But I need some condition,

if my draftName object key have string called "empty" I don't want to display data.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.351259 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO