[英]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): 我们目前正在使用以下内容(短期内不能更改):
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.