isaacplmann / ngx-tour

Product Tour Built in Angular
https://isaacplmann.github.io/ngx-tour
MIT License
246 stars 100 forks source link

how use it in ionic 3 #58

Closed Benoit-ROBIN closed 7 years ago

Benoit-ROBIN commented 7 years ago

Hi sorry for my english I try to use your library in my ionic 3 projet. I follow your doc but I can't make it works .

In console I have "ERROR Error: No provider for Router!" App module @NgModule({ declarations: [ MyApp, HomePage ], imports: [ BrowserModule, RouterModule, TourMatMenuModule.forRoot(), IonicModule.forRoot(MyApp) ], bootstrap: [IonicApp], entryComponents: [ MyApp, HomePage ], providers: [ StatusBar, SplashScreen, TourService, {provide: ErrorHandler, useClass: IonicErrorHandler} ] })

HomeComponent `@Component({ selector: "page-home", templateUrl: "home.html" }) export class HomePage {

constructor(public navCtrl: NavController, public tourService: TourService) {

this.tourService.initialize([{
  anchorId: 'some.anchor.id',
  content: 'Some content',
  title: 'First',
}, {
  anchorId: 'another.anchor.id',
  content: 'Other content',
  title: 'Second',
}]);

this.tourService.start();

}

}`

Benoit-ROBIN commented 7 years ago

I resolve my problem ;), but I don't understand why I have to define a RouterModulein my app.module.

isaacplmann commented 7 years ago

The tour library uses the router to go to the next step if that step is on a different route. It probably would be good to make that an optional dependency for people that don't want to use that feature.