【发布时间】:2019-09-19 08:40:31
【问题描述】:
我想以表格格式显示我的数据,它出现在输入字段中但不在表格中,为什么会这样?我该如何解决这个问题。
<!DOCTYPE html>
<h1>Call Details Dashboard </h1>
<label>Name:</label>
<select [(ngModel)] = "selectedLevel" (change)="selected()" >
<option *ngFor="let post of posts | async" [ngValue]="post">{{post.user}}
</option>
</select>
<table class="TFtable">
<tr >
<th>Name</th> <th>Duration</th> <th>Time</th> <th>Type</th>
</tr>
<tr *ngFor="let post of posts |async" [(ngModel)] = "selectedLevel.user">
<td>{{ post.callDuration }}</td>
<td>{{ post.callTime }}</td>
<td>{{ post.callType }}</td>
</tr>
</table> //require not as per my requirement
<label>Duration:</label>
<input type="type"name="callDuration" [(ngModel)]="selectedLevel.callDuration"> //wokring perfect
【问题讨论】:
-
你在表中缺少
| async..... -
是的!谢谢你。那行得通。但我只想要用户通过下拉菜单选择的数据。
-
那么你需要过滤你想要的值
-
任何例子
标签: angular google-cloud-firestore