Changement pour appeler l'API C# par Angular

+ récupération des datas et leur affichage
This commit is contained in:
Sébastien André
2019-10-07 15:03:09 +02:00
parent 9710b37353
commit b98adf88ca
8 changed files with 76 additions and 26 deletions

View File

@@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { JumpResp } from '../../models/jump';
import { ServiceApi } from '../../services/serviceApi';
@Component({
selector: 'app-list-of-jumps',
@@ -6,10 +9,17 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./list-of-jumps.component.css']
})
export class ListOfJumpsComponent implements OnInit {
public listOfJumps: Observable<Array<JumpResp>>;
constructor() { }
constructor(private serviceApi: ServiceApi) {
}
ngOnInit() {
this.getListOfJumps();
}
getListOfJumps() {
this.listOfJumps = this.serviceApi.getListOfJumps();
}
}