Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ionic 4 get previous route

//Update angular 6+
//The events.filter gives error because filter is not part of events, so change the code to

import { filter, pairwise } from 'rxjs/operators';

this.router.events
.pipe(filter((evt: any) => evt instanceof RoutesRecognized), pairwise())
.subscribe((events: RoutesRecognized[]) => {
  console.log('previous url', events[0].urlAfterRedirects);
  console.log('current url', events[1].urlAfterRedirects);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to disable mouse right click in html page 
Javascript :: javascript how to print working directory 
Javascript :: loop through json object javascript 
Javascript :: how to create an invite discord.js 
Javascript :: vue call function every x seconds 
Javascript :: Error: Error: Could not resolve [object Object] / undefined at Scope.resolve 
Javascript :: stopped typing jquery 
Javascript :: change elements class javascript 
Javascript :: js ask before close 
Javascript :: invalid chai property 
Javascript :: react native go to next text input 
Javascript :: gdscript add child node 
Javascript :: how to get only month and year in js 
Javascript :: upsert mongoose 
Javascript :: current date in javascript 
Javascript :: js make obj invisible 
Javascript :: get docs with date intervals mongoose 
Javascript :: telli sense for jsx vscode 
Javascript :: Chart is not a constructor 
Javascript :: search box enter key javascript 
Javascript :: convert month name to month number in js 
Javascript :: how to get the min value of two variables in math 
Javascript :: getting data from firestore using async await 
Javascript :: place footer at the bottom of the page react 
Javascript :: nodejs increase heap size 
Javascript :: js money format br 
Javascript :: nuxt redirect traffic from http to https 
Javascript :: set an attribute background image javascript 
Javascript :: time difference in minutes in JS 
Javascript :: odd even condition with ternary operator 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =