You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Some components need to fetch data before they can be rendered. Currently we are initializing these calls in the OnInit hook; it would be nice if instead deferrable views with prefetch triggers could be leveraged to dynamically load necessary data ahead of rendering.
Proposed solution
I propose an OnPrefetch hook that components and directives can implement which is called when the component or directive has been pre-fetched in a deferred view. This hook would be called before OnInit.
Alternatives considered
Alternatively a callback could be supplied to the prefetch trigger, which can be used to pre-load the data into a global store.
The text was updated successfully, but these errors were encountered:
Thnx for the suggestion but we are going to pass on this one. The main reason is that we don't think linking data fetching to the defer views. A given component can be used both inside a deferred view and outside of it - it would be very surprising if a component works in one scenario but not in another.
We do some projects planned to look into data fetching more holistically, though.
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Some components need to fetch data before they can be rendered. Currently we are initializing these calls in the OnInit hook; it would be nice if instead deferrable views with prefetch triggers could be leveraged to dynamically load necessary data ahead of rendering.
Proposed solution
I propose an OnPrefetch hook that components and directives can implement which is called when the component or directive has been pre-fetched in a deferred view. This hook would be called before OnInit.
Alternatives considered
Alternatively a callback could be supplied to the prefetch trigger, which can be used to pre-load the data into a global store.
The text was updated successfully, but these errors were encountered: