What is the difference between ActivatedRouteSnapshot and ActivatedRoute in Angular 4? It\'s my understanding that ActivatedRouteSnapshot
There are 2 ways to get the parameter from the route.
route.snapshot.paramMap.get). Read it during init.Use the Snapshot if you only need the initial value of the parameter once during the component's initialization, and don't expect the URL to change while the user is still on that same component.
route.paramMap.subscribe). Subscribe to it during init.Use the Observable if it's possible for the route to change while the user is still on the same component, and hence the Component's initialization would not be called again, but the observable would call your subscribed logic when the URL changed.
Generally speaking, subscribing is the safest route if you're unsure.