Reputation: 61
I am using Angular2 and PrimeNg to create a form.. There is a button that needs to be disabled when the form is not dirty or when it is invalid. All the things work well on Chrome but not on IE11. Here is the code ... the Modify button is not disabled as expected.
<button pButton type="submit" icon="fa-pencil" (click)="modify()"
[disabled]="!form.dirty || form.invalid ||
disableModifyButton" disabled="true" label="Modify"></button>
Any ideas on how to solve this?
Upvotes: 1
Views: 993
Reputation: 696
disabled
only have one attribute value is disabled
, so try this
[disabled]="(!form.dirty || form.invalid || disableModifyButton) ? 'disabled' : null"
Upvotes: 1