mardi 1 septembre 2015

angularjs set checkbox checked using expression

I'm trying to set checked = "checked" for a checkbox inside a ng-repeat

My current code is :

<tr ng-repeat="current in listobjects" on-list-displayed>
    <input type="checkbox" name = "status" value="1" {{ current.status > 0 ? ' checked="checked"' : '' }}>
</tr>

But

{{ current.status > 0 ? ' checked="checked" : "" }}

is not parsed by angularjs and displayed as text

What's wrong ?




Aucun commentaire:

Enregistrer un commentaire