SHARE
TWEET

Untitled

a guest May 26th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { forkJoin, Observable } from 'rxjs';
  2. import {subjectServices} from './subjectServices.ts'
  3. @Component({
  4. selector: 'app-root',
  5.   templateUrl: './app.component.html',
  6.   styleUrls: ['./app.component.css']
  7. })
  8. export class AppComponent {
  9.   constructor(private SubjectServices : subjectServices){
  10.   }
  11.  
  12.   callBothSubjectSimultaneously(){
  13.     let response1 = this.SubjectServices.observableOne();
  14.     let response2 = this.SubjectServices.observableTwo();
  15.     let allResponse = ForkJoin(response1, response2);
  16.     allResponse.subscribe(responseList =>{
  17.       let responseData1 = responseList[0];
  18.       let responseData2= responseList[1;
  19.     });
  20.   }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top