CirclonGroup / angular-tree-component

A simple yet powerful tree component for Angular (>=2)
https://angular2-tree.readme.io/docs
MIT License
1.09k stars 488 forks source link

Feature: Allow functions for node Fields #945

Open IBlackI opened 2 years ago

IBlackI commented 2 years ago

Pull request depends on #942

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Currently it is impossible to use the data of the node to programmatically determine the display. You can only use fixed values of the top level of the node data.

Resolves #793

What is the new behavior?

A function can be passed through the tree options which will evaluate the values for each node in the tree.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information