How to conditionally add a data attribute to a div in angularjs -


my code:

<div>something here</div> 

when condition true, eg: data.nextdiv == true

the code changed follow:

<div myattr >something here</div> 

my attempt:

<div ng-attr-myattr ="{{data.nextdiv == true ? null : null}}" >something here</div> 

but, fail, 'myattr' still printed out condition false.

anyone help?


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -