我无法在输入表单中显示数据。
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text text-white" style="background-color:#03a9f4">Product ID</span>
</div>
<input type="text" class="form-control" [(ngModel)]="productID" name="productID" readonly="true" style="background-color: white">
</div>
内部
component.ts
private productID: string;
private initData() {
this.productID = "12345"; //TODO REST call for data
}
ngOnInit() {
this.initData();
}
但由于某些原因,我的输入在页面加载时没有值。为什么?