Reputation: 121
I have a case where I allow the user to enter information in a form and then after they submit it they should get redirected back to the same form in a read-only view. I can see that the onSubmit is called the first time the user goes to the form, date is saved, and the code for the redirect is called (the URL also changes) but the form never shows the read-only view. Do I have to destroy the component first and then redirect (not sure how to destroy the component actually) or is there a better way?
Upvotes: 0
Views: 1884
Reputation: 41
I have same question with you, but I have solved it. It's my understanding, when we use router, angular2 will check the router path, when we router to same page, the router path has no change, the module data changed. The page only changes the module data, but never refreshes the page. So, we have two method to solve it.
Upvotes: 1