Changement pour appeler l'API C# par Angular
+ récupération des datas et leur affichage
This commit is contained in:
@@ -3,9 +3,8 @@
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<tr *ngFor="let dropZone of userObservable | async as listOfDropZones; index as i;">
|
||||
<td>{{ dropZone.Id }}</td>
|
||||
<td>{{ dropZone.Name }}</td>
|
||||
<tr *ngFor="let dropZone of this.listOfDropZones; index as i;">
|
||||
<td>{{ dropZone.id }}</td>
|
||||
<td>{{ dropZone.name }}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ServiceApi } from '../../services/serviceApi';
|
||||
|
||||
|
||||
export class ListOfDzsComponent implements OnInit {
|
||||
public listOfDropZones: Array<DropZoneResp>;
|
||||
public listOfDropZones: Array<DropZoneResp> = new Array<DropZoneResp>();
|
||||
|
||||
constructor(private serviceApi: ServiceApi) {
|
||||
}
|
||||
@@ -21,6 +21,6 @@ export class ListOfDzsComponent implements OnInit {
|
||||
|
||||
getListOfDropZones() {
|
||||
this.serviceApi.getListOfDropZones()
|
||||
.subscribe((data: Array<DropZoneResp>) => this.listOfDropZones = data);
|
||||
.subscribe(data => this.listOfDropZones = data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user