duck-booking-tool-front/app/app.component.ts
Gergely Polonkai f7bf483aa7 Change the duck to a list of ducks, finalize editor
Signed-off-by: Gergely Polonkai <gergely@polonkai.eu>
2016-09-09 14:41:37 +02:00

29 lines
528 B
TypeScript

import { Component } from "@angular/core";
import { Duck } from "./models";
const DUCKS: Ducks[] = [
{ id: 1, color: 'yellow' },
{ id: 2, color: 'blue' },
{ id: 3, color: 'pink' }
]
@Component({
selector: "duckbook-front",
templateUrl: "/app/app.component.html"
})
export class AppComponent {
ducks = DUCKS;
selectedDuck: Duck;
onSelect(duck: Duck): void {
console.log(duck);
this.selectedDuck = duck;
}
duck: Duck = {
id: 1,
color: 'yellow'
};
}