3e02eb4abb
It lost some functionality, but it was never put to use.
30 lines
767 B
TypeScript
30 lines
767 B
TypeScript
import { Component, OnInit} from "@angular/core";
|
|
import { ActivatedRoute, Params } from "@angular/router";
|
|
import { Location } from "@angular/common";
|
|
|
|
import { Duck } from "./models";
|
|
import { DuckService } from "./duck.service";
|
|
|
|
@Component({
|
|
moduleId: module.id,
|
|
selector: "duck-detail",
|
|
templateUrl: "duck-detail.component.html"
|
|
})
|
|
export class DuckDetailComponent {
|
|
duck: Duck;
|
|
|
|
constructor(
|
|
private duckService: DuckService,
|
|
private route: ActivatedRoute,
|
|
private location: Location)
|
|
{}
|
|
|
|
ngOnInit(): void {
|
|
this.route.params.forEach((params: Params) => {
|
|
let id = +params['id'];
|
|
this.duckService.getDuck(id)
|
|
.then(duck => this.duck = duck);
|
|
})
|
|
}
|
|
}
|