src/lib/navigation-service.service.ts
Properties |
Methods |
constructor(wrapperService: WrapperNavigateService, routerService: RouterServiceService)
|
|||||||||
Defined in src/lib/navigation-service.service.ts:10
|
|||||||||
Parameters :
|
initService | ||||||
initService(wrapperService: string)
|
||||||
Defined in src/lib/navigation-service.service.ts:18
|
||||||
used to intialize the navigation service with the wrapperservice or routerservice
Parameters :
Returns :
void
|
navigate | ||||
navigate(input)
|
||||
Defined in src/lib/navigation-service.service.ts:25
|
||||
used for navigating to the other pages based on the service initalized
Parameters :
Returns :
void
|
navigateService |
Type : any
|
Default value : "routerService"
|
Defined in src/lib/navigation-service.service.ts:10
|
import { Injectable, OnInit } from '@angular/core';
import { RouterServiceService } from './router-service.service';
import { WrapperNavigateService } from './wrapper-navigate.service';
@Injectable({
providedIn: 'root'
})
export class NavigationServiceService {
navigateService: any = "routerService"
constructor(private wrapperService: WrapperNavigateService,private routerService: RouterServiceService) { }
/**
* used to intialize the navigation service with the wrapperservice or routerservice
* @param {string} wrapperService
*/
initService(wrapperService: string) {
this.navigateService = wrapperService
}
/**
* used for navigating to the other pages based on the service initalized
* @param {} input
*/
navigate(input){
if(this.navigateService === 'routerService'){
this.routerService.navigate(input)
}else{
this.wrapperService.navigate(input)
}
}
}