From 7a1d23f253f88499e4379fcce685741e57385013 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 20 Jan 2022 16:11:28 +0530 Subject: [PATCH] single company choosed --- .../dynamic-question-template.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts index 6c96c13..e090ae9 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts @@ -132,14 +132,14 @@ export class DynamicQuestionTemplateComponent implements OnInit { setTimeout(()=>{ console.log(this.parent_ques); - if( this.parent_ques.answers ){ + if( this.parent_ques.answers && this.parent_ques.answers instanceof Array){ console.log(this.parent_ques.answers.length) console.log( this.formGroupN.get(this.parent_ques.question_key)) - if(this.parent_ques.answers.length == 1){ + if(this.parent_ques.type == '3' && this.parent_ques.answers.length == 1){ console.log(this.parent_ques.answers.answer_id) this.formGroupN.get(this.parent_ques.question_key).patchValue(this.parent_ques.answers[0].answer_id || '') - }else if(this.parent_ques.type == 3 && this.parent_ques.answers.length == 0){ + }else if(this.parent_ques.type == '3' && this.parent_ques.answers.length == 0){ console.log(this.parent_ques.answers.answer_id) this.formGroupN.get(this.parent_ques.question_key).patchValue(this.parent_ques.answers[0].answer_id || '') }