Skip to content

when applying md-button on a button, (click) is not triggered #3478

@maxime1992

Description

@maxime1992

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Even if a button has the md-button attribute we should be able to bind the click event.

What is the current behavior?

Checkout this line of HTML :

<button
*ngFor="let possibleState of getPossibleStateActions(serviceUnit.state)"
(click)="changeState(possibleState.newStateAfterAction)"
[disabled]="serviceUnit.isUpdatingState"
>
  {{ possibleState.actionName }}
</button>

the changeState function is called.


But if I add md-button or md-raised-button on the button, the design is the one expected but clicking on the button never triggers changeState function.


What are the steps to reproduce?

git clone https://gitlab.com/linagora/petals-cockpit.git
git checkout ab7f5d5816
cd frontend
yarn
ng serve

I did try to reproduce on Plunkr but I couldn't.
I didn't check the version on Plunkr but maybe Angular is running on 2.x and my project is running 4.0.0-rc.2.

Which versions of Angular, Material, OS, browsers are affected?

4.0.0-rc.2 (didn't try under that version)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions