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.
Error: No provider for OnsNavigator!
-
When using ons-navigator inside ons-splitter provide below error
my source is below
- boot.ts :
- app.component.ts
- splitside.component.ts
- sidecontent.component.ts
- splitcontentpage1.component.ts
- splitcontentpage2.component.ts
please advice how to fix the problem. possible give us sample
thanks
kasim
- boot.ts :
-
@kasim This example is for vanilla and I don’t know Angular 2 well enough to chime it, but maybe it will point you in the right direction. http://tutorial.onsen.io/?framework=vanilla&category=Community tutorials&module=splitter_navigator
-
@kasim Did you ever resolve this? I am running into similar issues with OnsNavigator and I’m not sure what I’m doing wrong.
Thanks.
-
Hi, @kasim!
I have checked your code.
SidePageComponent
seems to try to inject anOnsNavigator
instance, but the ancestor components ofSidePageComponent
have noons-navigator
in their templates.
So the hierarchical dependency injector of Angular could not find a corresponding provider forOnsNavigator
instance which registered inContentPageComponent
and reported the error likeNo provider for OnsNavigator
.You can fix this problem by connecting
SidePageComponent
withContentPageComponent
via a service.The official guide for Angular component interaction is here:
https://angular.io/docs/ts/latest/cookbook/component-communication.html