Skip to content

Instantly share code, notes, and snippets.

@cpanuphan
Last active September 19, 2018 04:02
Show Gist options
  • Save cpanuphan/cfc36ada7da36c46d2dd0a3628516b10 to your computer and use it in GitHub Desktop.
Save cpanuphan/cfc36ada7da36c46d2dd0a3628516b10 to your computer and use it in GitHub Desktop.
Initial file
import { Component } from '@angular/core';
import { TodoItem } from '../todo-item';
@Component({
selector: 'app-todo-add',
templateUrl: './todo-add.component.html',
styleUrls: ['./todo-add.component.css']
})
export class TodoAddComponent {
newTodo: TodoItem = new TodoItem();
onAddTodo() {
// เราจะมาเพิ่ม code ทีหลังเมื่อเราสร้าง TodoDataService เสร็จแล้ว
console.log("Add Todo: " + this.newTodo.name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment