Get Projects
This commit is contained in:
parent
a4fee58983
commit
5863ad4e16
|
@ -35,7 +35,21 @@ export class ProjectsComponent implements OnInit{
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.projects = this.serverService.getDummyProjects()
|
||||
//this.projects = this.serverService.getDummyProjects();
|
||||
this.projects = [];
|
||||
this.serverService.getProjects().subscribe(
|
||||
response => {
|
||||
|
||||
console.log("response");
|
||||
console.log(response);
|
||||
response.forEach(resp => {
|
||||
let pr = new Project();
|
||||
pr.id = resp.id;
|
||||
pr.name = resp.label;
|
||||
this.projects.push(pr);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -69,22 +69,29 @@ export class ServerService {
|
|||
|
||||
}
|
||||
|
||||
getDummyProjects(){
|
||||
let projects :Project[] =[];
|
||||
getProjects(){
|
||||
|
||||
let project = new Project;
|
||||
project.name = "Project1";
|
||||
project.id = "Project1Id";
|
||||
let headers = new HttpHeaders().set("google-token", this.tokenService.getToken());
|
||||
|
||||
projects.push(project);
|
||||
console.log("google-token: "+ this.tokenService.getToken());
|
||||
|
||||
let project2 = new Project;
|
||||
project2.name = "Project2";
|
||||
project2.id = "Project2Id";
|
||||
return this.httpClient.get<any>("http://dl010.madgik.di.uoa.gr:8080/dmp-backend-no-sec/rest/project/listAllLabelIDs");
|
||||
|
||||
projects.push(project2);
|
||||
// let projects :Project[] =[];
|
||||
|
||||
return projects;
|
||||
// let project = new Project;
|
||||
// project.name = "Project1";
|
||||
// project.id = "Project1Id";
|
||||
|
||||
// projects.push(project);
|
||||
|
||||
// let project2 = new Project;
|
||||
// project2.name = "Project2";
|
||||
// project2.id = "Project2Id";
|
||||
|
||||
// projects.push(project2);
|
||||
|
||||
// return projects;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue