I am trying to disable button. But button is angular component. And Html5 disabled attribute cannot work on component selector.
I tried to add like this but does not work: [attr.disabled]="isOpenModal
Button Html code:
<add-new-button [attr.disabled]="isOpenModal"
(click)="openModal('new')"
class="nano-bc-green hover-effect">
</add-new-button>
Button - Component "add new button"
@Component({
selector: 'nano-add-new-button',
template: `
<div class='nano-f-r nano-f'>
<i class='fa fa-plus'></i>
<span class='nano-ml-5'>
Add New
</span>
</div>`
})
export class NanoAddNewButtonComponent {
}
Open Modal method which is used on button:
public openModal(id: string): void {
const data = {id: id};
this.modalModel.add(AudienceModel.ENTITY_NAME, data);
}
Any idea for solution?
pointer-events: none?@Inputin your component and bind it to the button you want to disable.