39 lines
940 B
TypeScript
39 lines
940 B
TypeScript
import {Component} from '@angular/core';
|
|
import {JSONP_PROVIDERS} from '@angular/http';
|
|
import {Observable} from 'rxjs/Observable';
|
|
import { RouteParams, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
|
|
|
|
import {ClaimsService} from '../../services/claims.service';
|
|
import {Claim} from '../../entities/claim';
|
|
|
|
@Component({
|
|
selector: 'claim',
|
|
templateUrl: 'src/app/claimPages/claim/claim.component.html',
|
|
providers:[ ClaimsService, JSONP_PROVIDERS, ...ROUTER_DIRECTIVES]
|
|
|
|
})
|
|
export class ClaimComponent {
|
|
constructor (private _claimService: ClaimsService,
|
|
private _routeParams: RouteParams) {}
|
|
ngOnInit() {
|
|
|
|
this.id = this._routeParams.get('id');
|
|
if(this.id!=null){
|
|
this.getClaim(this.id);
|
|
}
|
|
|
|
}
|
|
|
|
id : string;
|
|
claim : any;
|
|
getClaim (id: string) {
|
|
this._claimService.getClaim(id)
|
|
.then(data => {
|
|
this.claim = data;
|
|
console.log(data);
|
|
}) ;
|
|
}
|
|
|
|
|
|
}
|