Если я изменю параметры маршрута, в консоли ничего не регистрируется. Определен параметр id.
Кто-нибудь знает, почему это так не работает?
export abstract class GenericLeftPanelComponent<T extends ItemIdName>
implements OnInit, OnDestroy {
data: T[] = [];
protected getSubscription: Subscription = new Subscription();
protected mainSubscription: Subscription = new Subscription();
protected refreshSubscription: Subscription = new Subscription();
protected startSubscription: Subscription = new Subscription();
protected constructor(
protected genericService: GenericService<T>,
protected router: Router,
protected route: ActivatedRoute,
@Optional() draggable: boolean
) {
this.actionButtons = actionButtons;
this.tableColumnDefinition = tableColumnDefinition;
this.draggable = draggable;
}
ngOnInit() {
this.get();
this.refresh();
this.startSubscription.add(
this.route.params.subscribe(params => {
if (this.route.snapshot.paramMap.has('id')) {
console.log("view -", this.route.snapshot.params.id);
}
})
);
...