title: How to bind boolean values in angular directives?
body: <p>I'd like to bind/set some boolean attributes to a directive. But I really don't know how to do this and to achieve the following behaviour.</p>
  
  <p>Imagine that I want to set a flag to a structure, let's say that a list is collapsable or not. I have the following HTML code:</p>
  
  <pre><code>&lt;list items="list.items" name="My list" collapsable="true"&gt;&lt;/list&gt;
  </code></pre>
  
  <p><code>items</code> are two-way binded, <code>name</code> is just an attribute</p>
  
  <p>I'd like that <code>collapsable</code> attribute to be available in the list's $scope either by passing a value (true, false or whatever), either a two-way binding</p>
  
  <pre><code>&lt;list items="list.items" name="{{list.name}}" collapsable="list.collapsed"&gt;&lt;/list&gt;
  </code></pre>
  
  <p>I'm developing some UI components and I'd like to provide multiple way of interacting with them. Maybe, in time, some guys would like to know the state of that component, either is collapsed or not, by passing an object's property to the attribute.</p>
  
  <p>Is there a way to achieve this? Please correct me if I missunderstood something or I'm wrong.</p>
  
  <p>Thanks</p>