Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let aEntity: AEntity = new AEntity(undefined, Status.FULL);
- // Getting the assigned ID of the above AEntity
- this.aEntityService.create(aEntity).subscribe((aResponse) => {
- aEntity = aResponse.body;
- this.formDataMap.forEach((value: AnswerMgm, key: String) => {
- const question: Question = this.questionsMap.get(Number(key));
- const answer: Answer = value;
- const bEntity: BEntity = new BEntity(aEntity.id, question, answer);
- // persist the bEntity
- this.bEntityService.create(bEntity)
- .toPromise()
- .then((response: HttpResponse<BEntity>) => {
- const bEntityResult: BEntityMgm = response.body;
- console.log('BEntity response: ' + JSON.stringify(bEntityResult));
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement