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