nickperkinslondon / angular-bootstrap-nav-tree

An AngularJS directive that creates a Tree based on a Bootstrap "nav" list.
MIT License
681 stars 301 forks source link

Is it possible to have custom label name? #105

Open deleugpn opened 8 years ago

deleugpn commented 8 years ago

Suppose I have a ready-to-go resource of data, but I would need it to have a different attribute for label and also for children. Is this possible?

I tried setting <abn-tree ... tree-label="name">, but no success.

Example of data:

[{
    "name": "John"
}, {
    "name": "Kelly",
    "emails": [{
        "email": "kelly@gmail.com"
    }, {
        "email": "kelly@live.com"
    }]
}]

John would have no expansion because it have no "children" (which is labeled as email here). Kelly would expand to "emails".