简体   繁体   中英

Why does not angular create ng-reflect-_opened=“false” when compiled for production?

We are currently using following (and can not change in the short term):

  • Angular 2 RC5
  • Angular CLI 1.0.0-beta.10
  • Material Design Side Nav Control
  • Node 6.9.1
  • npm 3.10.8
  • Windows 10

When we build the code (with ng serve with development settings ie production is false and development is true), we see following output and the side nav control and it works great as it outputs following html output:

 <md-sidenav align="end" layout-padding="" style="width:100%" ng-reflect-align="end" ng-reflect-_opened="false" class="md-sidenav-end md-sidenav-over md-sidenav-closed"> 

When we build the same code (with production = true and development = false), it does not output ng-reflect-_opened or class attributes at all as shown below:

 <md-sidenav align="end" layout-padding="" style="width:100%"> 

I have no idea where to look to influence this behavior so that it outputs the same markup for both production and development.

Appreciate any help in this regard.

ng-reflect-${name} attributes are added for debugging purposes and show the input bindings that a component/directive has declared in its class. This is why your code is different on production.

Please see this for more details: https://stackoverflow.com/a/43473682

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM