The (click) is "attached" to you component, not to the mat-button. It's the reason you can "click" your component. You can use some like
<my-button (click)="!signBtn_disabled && signIn()"
[disabled]="signBtn_disabled">
Yes, is very common use the construction (event)="condition && function()". If the condition is not fullfilled, the function is not executed
Other option is that your component has an Output
@Output() customClick:eventEmitter=new EventEmitter<any>()
<mat-button (click)="customClick.emit(true)" [disabled]=...>
And you use
<my-button (customClick)="signIn()"></my-button>
Update I'm asking me if we can call to our "Output" click.
Saddly the click happens always we make a "click" in our component (not only in the inner button). So Imagine we have in out my-button component some like
<h1>I'm a custom button</h1>
<button (click)="onClick($event)" [disabled]="...">button</button>`
//we call out Output "click"
@Output()click:EventEmitter<any>=new EventEmitter<any>()
onClick(event)
{
event.stopPropagation()
this.click.next(true)
}
We can use in out parent
<my-button (click)="click($event)"></my-button>
All look like good if we "click" in the button, but if we click in the "h1", the event click happens in our parent. The only is check the event in parent
click($event){
if ($event===true)
{
..do something..
}
}
Or in parent
<my-button (click)="$event===true && click($event)"></my-button>