Add the view to show the list of DZs

This commit is contained in:
Sébastien André
2019-10-02 14:33:42 +02:00
parent bbb5c59794
commit 7d6d69550c
6 changed files with 104 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { DropZoneResp } from '../models/dropzone';
@Injectable()
@@ -7,6 +7,12 @@ export class ServiceApi {
constructor(private http: HttpClient) { }
public getListOfDropZones() {
return this.http.get<DropZoneResp>('http://localhost:1234/api/DropZone');
const httpOptions = {
headers: new HttpHeaders({
'Access-Control-Allow-Origin': 'https://localhost:44344',
})
};
return this.http.get<Array<DropZoneResp>>('https://localhost:44344/api/DropZone', httpOptions);
}
}