title: How to pass a variable to data-target data-toggle in AngularJS/Bootstrap
body: <p>I am trying to execute this code </p>
  
  <pre><code>data-toggle="collapse" data-target={{form.$invalid ? '#errorP2' : '#infoDiv'}}
  </code></pre>
  
  <p>which will toggle either info or error according to the form validity.</p>
  
  <p>How can I do that ?</p>
  
  <p>AngularJS : 1.4  --- Bootstrap 3</p>