I have a component, inside that there are 4-5 components. I want to disable
the Save button if any of the form's mandatory fields are not selected or
filled.
<p-tabView>
<p-tabPanel header="General" [selected]="true">
<data-general [data]="data" (modalSave)=
"childData($event)"></data-general>
</p-tabPanel>
<p-tabPanel header="Additional" *ngIf="this.isEditData">
<data-additional [data]="data" (modalSave)=
"additionalValid($event)"></data-additional>
</p-tabPanel>
<p-tabPanel header="Test" *ngIf="this.isEditData">
<test-component></test-component>
</p-tabPanel>
<p-tabPanel header="Test2" *ngIf="this.isEditData">
<data-test2></data-test2>
</p-tabPanel>
</p-tabView>
<button type="submit" class="btn btn-primary" [disabled]="!isFormValid()" (
click)="onSubmitBtnClick()">Save</button>
I tried to implement method isFormValid, define and check properties to
check the validity of each form. but I'm not able to do.
data-general, data-additional, test-component and data-test2 are the child
components.
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.