ng2-tree
ng2-tree copied to clipboard
Incompatibility with Angular 6 AOT (Cannot read property 'New' of undefined)
Hi. Using Angular 6 and building the application for production (AOT). When creating the tree it gives this error and the tree is not created. :-(
The error seems to occur in: ng2-tree\src\tree.js: 858.
function () { return this.node._status === tree_types_1.TreeStatus.New; };
Yes it has to do with angular 6 and it's in production mode only. Was about to deploy an app and this blew everything off. Now, I'm not sure if it's worth waiting a fix or going straight after the new native angular material tree widget.
I think it's related to the "buildOptimizer". I turned it off in the file "angular.json" (configurations-> production-> buildOptimizer). I have set it to "false" and now it works for me !! I do not know if it is ng2-tree or buildOptimizer problem. While it is fixed I will leave it deactivated.
@reimago thanks I'll give that I try. For now I just downgraded to angular 5 to get things going fast.
The issue is still there. We can't go back to angular 5. Is there any solution for this with Angular 6 AOT @rychkog , @akkumar