components icon indicating copy to clipboard operation
components copied to clipboard

md-button click event in *ngIf;else template doesn't work

Open jponeill opened this issue 9 years ago • 5 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

click event should work w/in *ngIf "else" branch template.

What is the current behavior?

function assigned to click event doesn't get called in else template

What are the steps to reproduce?

Create a component w/ the following template and a "testClick" method.

<div *ngIf="true;else #disp"> <button md-button (click)="testClick()">works (when condition above is true)</button> </div> <button md-button (click)='testClick()'>works (not in template)</button> <ng-template #disp> <button md-button (click)="testClick()">doesn't work</button> <button (click)="testClick()">works (not md-button)</button> </ng-template>

What is the use-case or motivation for changing an existing behavior?

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

Angular 4.0.0-rc.2 Material 2.0.0-beta.2 Chrome 56

Is there anything else we should know?

Using 4.x *ngIf;else so might be a Angular4 compatibility issue

jponeill avatar Mar 06 '17 17:03 jponeill

I think this problem is caused by #14873 https://github.com/angular/angular/issues/14873

leo6104 avatar Mar 06 '17 18:03 leo6104

Does https://github.com/angular/angular/pull/15066 fix this issue? I also noticed mdTooltip isn't working with elements that transpile content <ng-template>, <ng-container> is this caused by same issue?

sasxa avatar Mar 15 '17 00:03 sasxa

@sasxa the pull request angular/angular#15066 merged after angular rc.3 released. Please wait for next release - rc.4.

leo6104 avatar Mar 15 '17 04:03 leo6104

@jponeill You can close this issue. This problem was solved with Angular 4.0 rc.4 update :)

leo6104 avatar Mar 24 '17 04:03 leo6104

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.