Material: Subheader calls constructor of children twice

Created on 20 Dec 2016  路  4Comments  路  Source: angular/material

Actual Behavior:

  • When using md-subheader and transcluding custom components the constructor of the class is called twice *
  • It should be called once

CodePen (or steps to reproduce the issue): *

  • <md-subheader><my-custom-component></my-custom-component></md-subheader>
  • log something in the constructor of the controller: it will appreat twice in the log:

Angular Versions: *

  • Angular Version:1.5.9
  • Angular Material Version:1.1.1

Additional Information:

  • Browser Type: *
  • Browser Version: *
  • OS: *
  • Stack Traces:

Shortcut to create a new CodePen Demo.
Note: * indicates required information. Without this information, your issue may be auto-closed.

Do not modify the titles or questions. Simply add your responses to the ends of the questions.
Add more lines if needed.

duplicate

Most helpful comment

@ThomasBurleson We had a lot issues about similar things, e.g that the ng-repeat is called twice for example.

This is caused by the sticky clone elements we compile at runtime. We have a big issue for this https://github.com/angular/material/issues/9361

All 4 comments

ok, is there an issue number also known? then I can subscribe

@DevVersion - do we have an previous issue existing for this known code issue ?

@ThomasBurleson We had a lot issues about similar things, e.g that the ng-repeat is called twice for example.

This is caused by the sticky clone elements we compile at runtime. We have a big issue for this https://github.com/angular/material/issues/9361

Closing this as it's tracked in https://github.com/angular/material/issues/9361.

Was this page helpful?
0 / 5 - 0 ratings