I want to have back-to-the-previous page.
Previous Page: job.html Current Page: jobDetail.html
As per instructions, I have added import { Location } from '@angular/common';
to the jobDetail.component.ts
file at the top followed by
export class MyDetailComponent implements OnInit {
constructor(private location: Location) {}
ngOnInit() {
this.location.subscribe(x => console.log(x));
}
}
I have a html code in jobDetail.html but don't know how to proceed further. How do I add a previous button correctly. There's no easy tutorial for newbies like me.
<a routerLink="">Back</a>