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.
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:
<list items="list.items" name="My list" collapsable="true"></list>
items
are two-way binded, name
is just an attribute
I'd like that collapsable
attribute to be available in the list's $scope either by passing a value (true, false or whatever), either a two-way binding
<list items="list.items" name="{{list.name}}" collapsable="list.collapsed"></list>
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.
Is there a way to achieve this? Please correct me if I missunderstood something or I'm wrong.
Thanks