如何在Angular Node JS HTML中拉数组子文档mongodb

时间:2018-11-29 20:22:08

标签: html node.js angular mongodb

我是Angular,node和MongoDB的新手,并试图使用MongoDB的angular和backend创建一个小的用户界面。如何在html页面中调用子文档数组?

下面是我的html,用于收集插入MongoDB中的集合中的主要文档

      <label>City</label>
      <input type="text" class="form-control" name="city" [(ngModel)]="customer.city" #city="ngModel" >

下面是我的收藏集

enter image description here

我的问题,对于firstinitial和Answer数组,如何用html编写?

下面的代码不起作用

      <input type="text" class="form-control" [(ngModel)]="customer.answersId" name="answers"   #answers.firstInitial="ngModel"/>

      <input type="text" class="form-control" [(ngModel)]="customer.answersId" name="answers"   #answers.id[0]="ngModel"/>

请帮助我,谢谢!

0 个答案:

没有答案