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 field other than "label" and "children"? #111

Open nasr18 opened 7 years ago

chriscohoat commented 7 years ago

As far as I can tell it's possible but you need to modify the directive itself.

I needed to add a count next to the label so I modified abn_tree_directive and the template like so:

...<span class=\"indented tree-label\">{{ row.label }} </span><span class='count'>{{ row.count }}</span></a>...

And modified the scope.tree_rows call to include the count as well:

scope.tree_rows.push({
    level: level,
    branch: branch,
    label: branch.label,
    count: branch.count,
    classes: branch.classes,
    tree_icon: tree_icon,
    visible: visible
});

Not ideal, but is a quick way to get it working.

ruisilva450 commented 7 years ago

@chriscohoat you should PR that. It's just what I wanted! Thanks!