javascript - AngularJs: nested condition in ngif -


i displaying data using ng-if inside tag. have nested condition run determine content show. if use simple condition below works:

<tr ng-repeat="tag in tagdetails"> <td ng-if ("tag.arrayval[1].state && tag.arrayval[1].state == 'kar'")tag.arrayval[1].state</td> </tr> 

but below code not work when add () , put || condition inside ():

<td ng-if="(tag.arrayval[1].state && tag.arrayval[1].state == 'tam') || (tag.arrayval[0].state && tag.arrayval[0].state == 'tam')"></td> 

how handle case in angular when not sure order of elements in array columns fixed show specific values array.

data structure of tagdetails:

"arrayval":        [            {                "state": "kar",                "country": "india",                "region": "asia",                "availability": "available"            },            {                "state": null,                "country": null,                "region": null,                "availability": null            }        ]    }, 

please me.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -