Answer the question
In order to leave comments, you need to log in
How to implement a transition inside the same component in angular2?
There is a Profile component - a user card. The request for user information lies in ngOnInit(), i.e. called only when the ngOnInit() function from the OnInit interface fires.
Problem:
We are on the card of one of the users. This card has links to the cards of two other users: /profile1 and /profile2. When you click on any of them, the url changes, but requests from ngOnInit() do not occur.
How to be?
Tried other lifecycle interfaces, but only ..Changes works. And they work for every sneeze, which is completely unnecessary.
Now a crutch is screwed on: by clicking on the user's link, manually call the data update function on the card. This solves the problem, but only if we are in the Profile component, from other components such a crutch turns into a giant SuperMegaCrutch.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question