Call API before view loaded

#1

Hi,
I have a provider to retrieve data from my API and i need to call it in ionViewWillEnter() of a controller. But provider is only been initialized after page loaded, so i want to ask if there is any way to initialize a provider before constructor() run?
Thanks.

#2

see my example hereā€¦ you should be using ionViewCanEnter as a guard to load data and only if it resolves do we go forward

1 Like