javascript - AngularJS: directive to toggle class depending on array value -


i'm new angular , have ng-grid table. want save clicked elements in array (so elements uniquely correspond table cells) , strike cells through, in array. has happen in "toggleable" way.

so far cells like:

<div ng-click="myfunc(args)" ...><span>text</span></div>

and myfunc takes care of array, in factory. did dom manipulation same function thought angular way should create directive span element, evaluates array , depending on whether object corresponds cell containing particular span css class attached.

fyi: elements in array contain coordinates of cells (x,y), stored interaction server.

bind array scope , use ng-class syntax bind class matching condition. condition not straightforward, wrote function evaluate condition , works fine ng-class


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -