2016-09-06 13:35:20 +00:00
|
|
|
import { Component, OnInit } from "@angular/core";
|
|
|
|
|
|
|
|
import { DuckService } from "./duck.service";
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "dashboard",
|
2016-10-27 15:52:55 +00:00
|
|
|
templateUrl :"app/dashboard.component.html",
|
|
|
|
styleUrls: ["app/dashboard.component.css"]
|
2016-09-06 13:35:20 +00:00
|
|
|
})
|
|
|
|
export class DashboardComponent implements OnInit {
|
|
|
|
ducks: Duck[] = [];
|
|
|
|
|
2016-10-27 15:52:55 +00:00
|
|
|
constructor(private duckService: DuckService) {}
|
2016-09-06 13:35:20 +00:00
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.duckService.getDucks()
|
2016-10-27 15:52:55 +00:00
|
|
|
.then(ducks => this.ducks = ducks);
|
2016-09-06 13:35:20 +00:00
|
|
|
}
|
|
|
|
}
|