angular router back code example
Example 1: angular router return back
import {Component} from '@angular/core';
import {Location} from '@angular/common';
@Component({
// component's declarations here
})
class SomeComponent {
constructor(private _location: Location)
{}
backClicked() {
this._location.back();
}
}
Example 2: angular [routerlink]
content_copy
link to user component
Example 3: how to create app.routing.module.ts in angular 6
ng generate module app-routing --flat --module=app