我在输入表单中显示数据时遇到了问题。
 <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();
  }但是由于某些原因,我的输入在页面加载时没有值。为什么会这样呢?
发布于 2019-04-07 21:33:02
在这里,我已经为你创建了一个stackblitz,它正在工作。我已经复制了你的代码,请再检查一遍。
https://stackoverflow.com/questions/55558918
复制相似问题