What is the best way to take the value of my id in the current route (with ActivatedRoute or Router) ? And explain why :)
n°1
constructor(private route: ActivatedRoute) {}
ngOnInit() {
this.id = this.route.snapshot.params['id']
}
n°2
constructor(private router: Router) {}
ngOnInit() {
this.id = this.router.url.includes('id')
}