Angular - Routing
What is wrong with this code if the goal is to log the route parameter 'id' whenever it changes?
ngOnInit() {
const id = this.route.snapshot.params['id'];
console.log(id);
}