Added direct attribute and used $parse for event handling
I added a direct attribute to be able to prevent the need for modifier keys. E.g.
<ul ng-tree="model" multiple direct>
will always use multiple selection
Furthermore, the $event is now sent along with the select handler. This way, one can do
<ul ng-tree="model">
<li select="selected($event)">{{item.name}}</li>
</ul>
$scope.selected = function (e) {
console.log(this.item.name + ' is selected: ' + this.$selected);
console.log('event',e);
};
Also added an option to redefine the property that is used as selected. this defaults to $selected as before.
<li select="onSelect($event)"
selected="item.selected">
</li>
Looking at the code, this has been the intention thus far, but never implemented
Looks good. My only comment is that I don't really like having a separate multiple and direct attributes, where direct only serves to modify multiple and has no meaning without it. It seems like multiple should have different values in this case. For example: "key" (the default, equivalent to "true" and ""), "direct", and "false" (equivalent to no attribute). The values "key" and "direct" don't feel very descriptive, but I can't think of anything better.