import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute, ParamMap, Params } from '@angular/router'; import {Location} from '@angular/common'; import { ServerService } from '../../../app/services/server.service'; @Component({ selector: 'dmp-detailed', templateUrl: './dmp-detailed.component.html', styleUrls: ['./dmp-detailed.component.css'] }) export class DmpDetailedComponent implements OnInit { constructor(private serverService: ServerService, private router: Router, private _location: Location, private route: ActivatedRoute) { } dmp : any; ngOnInit() { let sub = this.route.queryParams.subscribe(params => { let dmpid = params.dmpid; this.serverService.getDmp(dmpid).subscribe( response => { this.dmp = response; debugger; }, error => { console.log("Could not load dmp"); } ) }); } }