Skip to content

Instantly share code, notes, and snippets.

@iradofurioso
Created August 12, 2019 21:24
Show Gist options
  • Save iradofurioso/215be8c084bd50443091f6181598dba3 to your computer and use it in GitHub Desktop.
Save iradofurioso/215be8c084bd50443091f6181598dba3 to your computer and use it in GitHub Desktop.
Updating Current URL in Angular 7 Apps | Pretty URL | Friendly URL
// import location
import {Location} from '@angular/common';
// add in constructor
private location: Location
//Updating current url
this.location.replaceState(`/my/url/${this.code}/${this.id}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment