Hi Francesco,

ngOnInit() {
 this.route.params
 .subscribe((params) => this.id = +params['id']);
}

Switchmap does what the name say's. it switches out the current observable 
and maps it to the result of the function you care giving it. When that 
function returns an observable, it will be used from that point on.

Subscribe is the activation operator, a bit similar (but not the same) as a 
.then on a promise. That is where you get/use the result. Without a 
subscribe, an observable does nothing. The async pipe in templates also 
does a subscribe.

Regards
Sander



-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to