In my HTML document, I have a ng-class
attribute with specific conditions. How can I access the attributes for twitter
and yahoo
within this code block?
ng-class="{twitter: 2 < id , yahoo : 2 > id}"
The typeof ng-class
is set to object
, but attempting to access it using elem["ng-class"]["twitter"]
does not produce the expected result.
Even using JSON.parse(obj)
fails to work properly.
An error occurs: Uncaught SyntaxError: Unexpected token t in JSON at position 1