In the final version of Angular 2.x / 4.x - here's the docs https://angular.io/docs/ts/latest/api/common/index/Location-class.htmlhttps://angular.io/api/common/Location
/* typescript */
import { Location } from '@angular/common';
// import stuff here
@Component({
// declare component here
})
export class MyComponent {
// inject location into component constructor
constructor(private location: Location) { }
cancel() {
this.location.back(); // <-- go back to previous location on cancel
}
}