Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Tree component can not get nodes sync , treeService undefined #3076
Steps to reproduce
What is expected?
getTreeNodes() in ngOnInit
What is actually happening?
referenced this issue
Mar 14, 2019
This issue should not be labelled as Bug.
Based on the life-cycle hooks, the nz-tree component is not setup when implement ngOnInit on its parent component. The correct hook could be used is AfterViewInit (Respond after Angular initializes the component's views and child views / the view that a directive is in.)
Please have a test on above stackblitz link and it works to use AfterViewInit.