I am trying to execute this code
data-toggle="collapse" data-target={{form.$invalid ? '#errorP2' : '#infoDiv'}}
which will toggle either info or error according to the form validity.
How can I do that ?
AngularJS : 1.4 --- Bootstrap 3
I guess you just see something like this in the rendered markup :
data-target="{{ ng-binding"form.$invalid ? '#errorP2' : '#infoDiv'}}
or similar. Wrap it into qoutes so angular have a chance to parse the expression, and use an expression. 1.4.x do support ternarys :
data-toggle="collapse" data-target="{{form.$invalid==true ? '#errorP2' : '#infoDiv'}}"