Hi Reza,
You get the data handed down to the next observable as a parameter. Also,
there is the .do operator that let you do side-effects.
it would look something like this:
let config;
loadConfig
.do( config => this.config = config) // side effect, do doesn't change
the the observable, it just passes it along
.switchMap( config => $http.get(config.url)
.switchmap( r => {
const addres .= r.toJson().webscocketAddres
return setupWSobservable(addres)
})
.subscribe(msg => handleWsdata(msg))
Typically, you only subscribe once, when you have set up the entire flow.
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.