Outline the duck editor
Signed-off-by: Gergely Polonkai <gergely@polonkai.eu>
This commit is contained in:
parent
4db5923857
commit
09ea2073dd
@ -1 +1,12 @@
|
|||||||
<h1>Hello!</h1>
|
<h1>Hello!</h1>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<label>id:</label>
|
||||||
|
{{ duck.id }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>color:</label>
|
||||||
|
<input [(ngModel)]="duck.color" placeholder="Color">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ duck.color }}
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
|
import { Duck } from "./models";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "duckbook-front",
|
selector: "duckbook-front",
|
||||||
templateUrl: "/app/app.component.html"
|
templateUrl: "/app/app.component.html"
|
||||||
})
|
})
|
||||||
export class AppComponent {}
|
export class AppComponent {
|
||||||
|
duck: Duck = {
|
||||||
|
id: 1,
|
||||||
|
color: 'yellow'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
import { NgModule } from "@angular/core";
|
import { NgModule } from "@angular/core";
|
||||||
import { BrowserModule } from "@angular/platform-browser";
|
import { BrowserModule } from "@angular/platform-browser";
|
||||||
|
import { FormsModule } from "@angular/forms";
|
||||||
|
|
||||||
import { AppComponent } from "./app.component";
|
import { AppComponent } from "./app.component";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [ BrowserModule ],
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
FormsModule
|
||||||
|
],
|
||||||
declarations: [ AppComponent ],
|
declarations: [ AppComponent ],
|
||||||
bootstrap: [ AppComponent ]
|
bootstrap: [ AppComponent ]
|
||||||
})
|
})
|
||||||
|
4
app/models.ts
Normal file
4
app/models.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export class Duck {
|
||||||
|
id: number;
|
||||||
|
color: string;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user