【发布时间】:2023-03-24 08:48:01
【问题描述】:
我使用 Angular-CLI 创建了一个新的 Angular 项目。
我使用的版本是:
Angular-Cli:1.0.2
角度:4.0.0。
我已经在其中添加了很多代码,但是现在,当我使用以下命令构建我的项目时,我得到了一堆错误
ng build --target=production --env=staging
错误:
/src/app/views/signup/signup.component.html (21,86):属性“电子邮件”受保护,只能在“SignUpComponent”类及其子类中访问。
/src/app/views/signup/signup.component.html (26,80):属性“密码”受保护,只能在“SignUpComponent”类及其子类中访问。
有人可以在这方面帮助我如何消除这些错误吗?当我省略 --target=production 时,构建成功,但在过去我遇到了一个问题,即没有指定目标浏览器缓存旧部署版本,用户必须删除浏览器缓存才能实现最新的更改/部署。
【问题讨论】:
标签: angular build angular-cli production