Open timkindberg opened 9 years ago
This shows the phases and how they are ordered: http://stackoverflow.com/questions/24615103/angular-directives-when-and-how-to-use-compile-controller-pre-link-and-post
Another idea is to keep controller instantiation as-is, perform lookup during the link phase, and then call the controller's onInit
lifecycle hook at that point. Might be a safer option and it leverages part of our Angular 2 polyfilling plans.
Ah yes... I think that might be more how Angular 2 works anyway.
I think we should wait until the post link phase until we invoke the Component's controller function. This way we'll know that we can have access to the child directives/components and they'll be fully linked and ready to go. This is a prerequisite to being able to query child components with @ContentChild and @ViewChild.