Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Pushing a page on startup of app
-
Hi, I was wondering how one would go about pushing a page on the startup of the application. I have a component I want to use on startup for a login page. I do a simple push page in ngOnInit but console says property ‘element’ is undefined.
@ViewChild(OnsNavigator) private _navigator: OnsNavigator; ngOnInit() { this._navigator.element.pushPage(SelectWicProviderPage); }
Is this because the component I want to load has not initialized yet(SelectWicProviderPage)?
-
Answering my own question here: The problem was that I simply did not have a <ons-navigator> tags wrapping the corresponding html page for the component. After wrapping the page in those tags, navigating worked fine.