Skip to main content
deleted 74 characters in body
Source Link
Bhargav Rao
  • 52.6k
  • 29
  • 130
  • 142

You can implement routerOnActivate()routerOnActivate() method on your route class, it will provide information about previous route.

routerOnActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) : any 

Then you can use router.navigateByUrl() and pass data generated from ComponentInstruction. For example:

this._router.navigateByUrl(prevInstruction.urlPath); 

You can implement routerOnActivate() method on your route class, it will provide information about previous route.

routerOnActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) : any 

Then you can use router.navigateByUrl() and pass data generated from ComponentInstruction. For example:

this._router.navigateByUrl(prevInstruction.urlPath); 

You can implement routerOnActivate() method on your route class, it will provide information about previous route.

routerOnActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) : any 

Then you can use router.navigateByUrl() and pass data generated from ComponentInstruction. For example:

this._router.navigateByUrl(prevInstruction.urlPath); 
added 16 characters in body
Source Link
Sasxa
  • 41.4k
  • 17
  • 90
  • 102

You can implement routerOnActivate() method on your route class, it will provide information about previous route.

routerOnActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) : any 

Then you can use router.navigateByInstructionnavigateByUrl() and pass it previous route instructiondata generated from ComponentInstruction. For example:

navigateByInstructionthis._router.navigateByUrl(instruction: Instruction, _skipLocationChange?: booleanprevInstruction.urlPath) : Promise<any>; 

You can implement routerOnActivate() method on your route class, it will provide information about previous route.

routerOnActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) : any 

Then you can use router.navigateByInstruction() and pass it previous route instruction.

navigateByInstruction(instruction: Instruction, _skipLocationChange?: boolean) : Promise<any> 

You can implement routerOnActivate() method on your route class, it will provide information about previous route.

routerOnActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) : any 

Then you can use router.navigateByUrl() and pass data generated from ComponentInstruction. For example:

this._router.navigateByUrl(prevInstruction.urlPath); 
Source Link
Sasxa
  • 41.4k
  • 17
  • 90
  • 102

You can implement routerOnActivate() method on your route class, it will provide information about previous route.

routerOnActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction) : any 

Then you can use router.navigateByInstruction() and pass it previous route instruction.

navigateByInstruction(instruction: Instruction, _skipLocationChange?: boolean) : Promise<any>