rxjs - Angular 2 Observable.forkJoin results -


i have following code in component:

public user: user; public roles: role[]; public organizations: organization[];  public ngoninit() {   this.user$ = this.userservice.getuser(1).share();   this.roles$ = this.roleservice.getroles().share();   this.organizations$ = this.organizationservice.getorganizations().share();    observable.forkjoin([this.user$, this.roles$, this.organizations$]).subscribe(data => {           this.user = data[0];     this.roles = data[1];     this.organizations = data[2];   }); } 

this should work think getting error in idea , wont compile, stuck on time now, can help?

enter image description here

service methods looks this:

public getroles(): observable<role[]> {         return this.http.get(this.api_url).map(res => res.json());  } 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -