argos/dmp-frontend/src/app/viewers/dmp-detailed/dmp-detailed.component.ts

44 lines
1.0 KiB
TypeScript
Raw Normal View History

2017-11-16 14:21:57 +01:00
import { Component, OnInit } from '@angular/core';
2017-11-22 13:25:01 +01:00
import { Router, ActivatedRoute, ParamMap, Params } from '@angular/router';
import {Location} from '@angular/common';
import { ServerService } from '../../../app/services/server.service';
2017-11-16 14:21:57 +01:00
@Component({
2017-11-16 15:16:09 +01:00
selector: 'dmp-detailed',
2017-11-16 14:21:57 +01:00
templateUrl: './dmp-detailed.component.html',
styleUrls: ['./dmp-detailed.component.css']
})
export class DmpDetailedComponent implements OnInit {
2017-11-22 13:25:01 +01:00
constructor(private serverService: ServerService, private router: Router, private _location: Location, private route: ActivatedRoute) {
2017-11-16 18:07:27 +01:00
}
2017-11-16 14:21:57 +01:00
2017-11-22 13:25:01 +01:00
dmp : any;
2017-11-16 14:21:57 +01:00
ngOnInit() {
2017-11-16 18:07:27 +01:00
2017-11-23 14:57:47 +01:00
console.log("LOADING DmpDetailedComponent")
2017-11-22 13:25:01 +01:00
let sub = this.route.queryParams.subscribe(params => {
let dmpid = params.dmpid;
2017-11-22 18:33:29 +01:00
let getParams : any = {"eager":true};
this.serverService.getDmp(dmpid, getParams).subscribe(
2017-11-22 13:25:01 +01:00
response => {
this.dmp = response;
},
error => {
console.log("Could not load dmp");
}
)
});
2017-11-16 14:21:57 +01:00
}
}