Assume I have a component which is called by route 'students' and rendered in student list component. Here I send a request to load all student names. When clicked on student I redirect to ':id' child route which shows detailed description of a student. Then when I press back button in browser ,it redirects back to 'students' route where a request sent again to load all students. Question: is it possible in Angular to not destroy parent route so when returned from child route it wont build again. I need that for performance improvement. Thanks
Asked
Active
Viewed 12 times
0
-
Yes, it is possible. Please add more detail so that we can actually give you a legit answer that fits your case. – Andrew Adam Nov 14 '17 at 15:16
-
You can also search for "custom reuse strategy", but for network requests using a shared service to keep the data is the better way anyway. – Günter Zöchbauer Nov 14 '17 at 15:17
-
you can use RouteReuseStrategy to reuse rendered component – Fateh Mohamed Nov 14 '17 at 15:24
-
thanks a lot ! I will try to add it to the project. – Vugar Abdullayev Nov 14 '17 at 19:03