Open jcamins opened 9 years ago
@jcamins I can't even get that example to work. How are you getting angular to evaluate your inject classes?
Edit: I got it to work only on leaf nodes -- iExpanded and iCollapsed aren't able to be interpolated it seems. Working on that right now.
I need this feature too. I imagine it to work as following:
$scope.treeOptions = {
injectClasses: {
li: function (node) {
return node.disabled ? 'disabled' : '';
}
}
};
I've tried this but it doesn't work.
I just created a pull request to add this ability. Unfortunately I can't use the existing properties of injectClasses
in an easy way (had no reference to node
at this point) so I had to create a new property.
In order to handle a "disabled" state and model-aware icons, it would be really useful to be able to inject ng-class into, e.g., the li tag for each node. Would you consider a PR that adds this feature?
Right now I'm doing the following, which works but doesn't seem quite idiomatic: $scope.indicatorOptions = { injectClasses: { li: 'disabled-{{node.disabled}}' } };