Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular how to get previous state

//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 :: declare * angular jquery 
Javascript :: javascript disable context menu 
Javascript :: Dropzone already attached 
Javascript :: create react app with tailwind 
Javascript :: check if input is required jquery 
Javascript :: how to replace commas with nothing in javascript 
Javascript :: find last element with class jquery 
Javascript :: To set the text of button using Jquery 
Javascript :: flutter jsonDecode UTF8 
Javascript :: jquery on checkbox checked es6 
Javascript :: you have no internet connection angular 
Javascript :: typing refs react 
Javascript :: javascript recorrer json 
Javascript :: create parent div javascript 
Javascript :: set radio button checked jquery 
Javascript :: node js sublime text 
Javascript :: hemisphere light three js 
Javascript :: sorting disable in datatable bootstrap 
Javascript :: check when keyup an input from a specific form jquery 
Javascript :: js remove spaces 
Javascript :: convert json string to javascript object 
Javascript :: corresponding text to key code js 
Javascript :: how to remove duplicates from array in javascript 
Javascript :: references another schema in sequelize 
Javascript :: phone number validation regex javascript 
Javascript :: make js file windows command 
Javascript :: handling scrolling on react router transitions 
Javascript :: js remove all objects from array where value 
Javascript :: get element property javascript 
Javascript :: select 2nd td jquery 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =