jeudi 6 août 2015

How check with angular if a value contains a certain value?

I have a value from a remote api that contains a comma separated list. The value is for example "4,6,7" that's displays in the template like this:

<li>{{detail[0].list}}</li>

I want to use ng-hide if the comma separated list contains a number that's in the list. How I check if there is a 6 (for example) in the comma separated list? the idea is:

<li ng-hide="if detail[0].list contains 6">{{detail[0].list}}</li>

Aucun commentaire:

Enregistrer un commentaire