Yes, you can use 2 different routes that point to the same component. But when you move from a route to another route that uses the same component as the previous route, angular reuses the instance of the component. It does not create a new instance of your component.
"signin" "/: id/signin", angular SignInComponent, "signin". init SignInComponent .
init. params ActivatedRoute . - , :
- ActivatedRoute
ngOnInit() {
this.route.params
.switchMap((params: Params) => this.service.getHero(+params['id']))
.subscribe((hero: Hero) => this.hero = hero);
}
switchMap Observable Observable.
, .
- . , , .