[英]How to create "NON PRODUCTION" banner in the app when we do "npm build" with a staging flag (--staging)?
[英]Using Local reference breaks while create a staging/production build (Angular)
以下是我在創建構建時遇到的模板代碼和錯誤,盡管它在我執行ng serve
時工作正常。
<input type="text" class="form-control unit-price" name="unit_price" [(ngModel)]="item.unit_price" #unitPrice="ngModel" required>
<span class="small text-danger" *ngIf="!unitPrice?.valid && unitPrice?.touched ">Field is Required</span>
有什么我想念的嗎?
我是否必須在組件中聲明該屬性?
在我的 UnderStanding項目對象內沒有unitPrice字段,請驗證您在 [(ngModel)] 中提到的項目對象。
另一方面,在您的代碼中將此: #unitPrice="ngModel"
轉換為: #unit_price="ngModel"
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.