I'm facing an issue with displaying data in input forms.
<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>
In my component.ts
, I have the following:
private productID: string;
private initData() {
this.productID = "12345"; //TODO REST call for data
}
ngOnInit() {
this.initData();
}
However, despite setting a value to the productID, it does not show up in the input field when the page loads. What could be causing this?