简体   繁体   English

在为生产进行编译时,为什么不按角度创建ng-reflect__opened =“ false”?

[英]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 角度2 RC5
  • Angular CLI 1.0.0-beta.10 Angular CLI 1.0.0-beta.10
  • Material Design Side Nav Control 物料设计侧导航控制
  • Node 6.9.1 节点6.9.1
  • npm 3.10.8 npm 3.10.8
  • Windows 10 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: 当我们构建代码时(使用ng服务进行开发设置,即生产为假,开发为true),我们看到以下输出和侧面导航控件,并且在输出以下html输出时效果很好:

 <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: 当我们构建相同的代码(production = true,development = false)时,它根本不输出ng-reflect__opened或class属性,如下所示:

 <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. ng-reflect-${name}属性用于调试目的,并显示组件/指令在其类中声明的输入绑定。 This is why your code is different on production. 这就是为什么您的代码在生产上会有所不同的原因。

Please see this for more details: https://stackoverflow.com/a/43473682 请查看此以获取更多详细信息: https : //stackoverflow.com/a/43473682

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的ng-class即使显示为false也显示 - Why does my ng-class display even when false 从角度上讲,为什么我的ng-show不更新以反映当前范围? - In angular, why are my ng-shows not updating to reflect the current scope? 为什么Angular在有标准maxlength时提供ng-maxlength? - Why does Angular provide ng-maxlength when there is a standard maxlength? 为什么我选择的ng-model无法反映我选择的ng-option? - Why does my select ng-model not reflect my selected ng-option? 为什么浏览器不反映JSP页面或Angular Controller中所做的更改? - Why Browser does not reflect changes made in JSP page or Angular Controller? 使用ng true和ng false时,Angular ng模型需要单击两次 - Angular ng model requires 2 click when using ng true and ng false 为什么即使输入字段已输入,Angular ng-message&#39;when =“ required”仍会触发? - Why does Angular ng-message 'when=“required”' fire even though the input field has input? 为什么编译的Angular代码使用闭包而不是类? - Why does compiled Angular code use closures instead of classes? 使用webpack编译时无法刷新生产中的页面 - Cannot refresh page in production when compiled with webpack 为什么 Azure DevOps 在隐身模式下打开时保持登录状态 - Why does Azure DevOps stay logged in when opened in Incognito
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM