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 be90a00..d47c7b5 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 @@ -32,23 +32,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { map(value => this.autoCompleteFilter(value)) ) } - if(this.parent_ques.type == '8') { - console.log("Initial",this.parent_ques.answers) - if(this.parent_ques.answers && this.parent_ques.answers.length > 0){ - this.ngxFilteredValue.next(this.parent_ques.answers.slice()) - this.filterList() - } - else{ - setTimeout(()=>{ - console.log("last",this.parent_ques.answers) - if(this.parent_ques.answers && this.parent_ques.answers.length > 0){ - this.ngxFilteredValue.next(this.parent_ques.answers.slice()) - this.filterList() - } - },1600) - } - this.filterList() - } + } ngOnChanges() { @@ -66,6 +50,23 @@ export class DynamicQuestionTemplateComponent implements OnInit { this.json_answers = null },700) } + if(this.parent_ques.type == '8') { + console.log("Initial",this.parent_ques.answers) + if(this.parent_ques.answers && this.parent_ques.answers.length > 0){ + this.ngxFilteredValue.next(this.parent_ques.answers.slice()) + // this.filterList() + } + else{ + setTimeout(()=>{ + console.log("last",this.parent_ques.answers) + if(this.parent_ques.answers && this.parent_ques.answers.length > 0){ + this.ngxFilteredValue.next(this.parent_ques.answers.slice()) + // this.filterList() + } + },1600) + } + this.filterList() + } } filterList() { this.commonFilterCtrl.valueChanges.pipe().subscribe(()=>{ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts index d23c908..1821b4a 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/form/form.component.ts @@ -56,6 +56,7 @@ export class FormComponent implements OnInit { ngOnInit() { this.loadTemplate() + console.log("answered",this.pd_all_details.is_answered) if(this.pd_all_details.is_answered == '1') { this.getSectionData() }