Changement pour appeler l'API C# par Angular
+ récupération des datas et leur affichage
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user