Advertisement
Guest User

ff

a guest
Jun 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         let aEntity: AEntity = new AEntity(undefined, Status.FULL);
  2.  
  3.         // Getting the assigned ID of the above AEntity
  4.         this.aEntityService.create(aEntity).subscribe((aResponse) => {
  5.             aEntity = aResponse.body;
  6.  
  7.             this.formDataMap.forEach((value: AnswerMgm, key: String) => {
  8.                 const question: Question = this.questionsMap.get(Number(key));
  9.                 const answer: Answer = value;
  10.  
  11.                 const bEntity: BEntity = new BEntity(aEntity.id, question, answer);
  12.  
  13.                 // persist the bEntity
  14.                 this.bEntityService.create(bEntity)
  15.                     .toPromise()
  16.                     .then((response: HttpResponse<BEntity>) => {
  17.                          const bEntityResult: BEntityMgm = response.body;
  18.                          console.log('BEntity response: ' + JSON.stringify(bEntityResult));
  19.                     });
  20.             });
  21.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement