Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expansion panel: Events not fired when running in AOT #8326

Closed
maxime1992 opened this issue Nov 9, 2017 · 4 comments
Closed

Expansion panel: Events not fired when running in AOT #8326

maxime1992 opened this issue Nov 9, 2017 · 4 comments

Comments

@maxime1992
Copy link

Bug, feature request, or proposal:

BUG

What is the expected behavior?

Be able to subscribe to mat-expansion-panel events (for example (closed)="...") in AOT

What is the current behavior?

With a simple mat-expansion-panel:

HTML

<mat-expansion-panel (closed)="onClosed()">
  <mat-expansion-panel-header>
    <mat-panel-title>
      Personal data
    </mat-panel-title>
    <mat-panel-description>
      Type your name and age
    </mat-panel-description>
  </mat-expansion-panel-header>

  Something
</mat-expansion-panel>

TS

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
})
export class AppComponent {
  onClosed() {
    console.log('Expansion panel closed!');
  }
}

Running:

  • ng serve and opening/closing the expansion panel displays the console.log
  • ng serve --aot and opening/closing the expansion panel DOES NOT displays the console.log

What are the steps to reproduce?

No plunkr or stackblitz as it's AOT related...
I've made a really simple repro available on github: https://github.com/maxime1992/repro-expansion-panel-bug-AOT

(I've also made clear commits in order show how I did my setup)

Run one instance with ng serve, the other with ng serve --aot and watch your console after opening/closing the panel.

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

Angular CLI: 1.5.0
Node: 8.6.0
OS: linux x64
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.0.0-rc0
@angular/cli: 1.5.0
@angular/material: 5.0.0-rc0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.2
typescript: 2.4.2
webpack: 3.8.1

Is there anything else we should know?

Just thank you for all your good work 😄

@willshowell
Copy link
Contributor

Fixed on master via #7309

@bardiel
Copy link

bardiel commented Nov 9, 2017

Also, meanwhile, this workarround #7172 (comment)

@maxime1992
Copy link
Author

Excellent, thx guys :)

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants