Skip to content

Instantly share code, notes, and snippets.

@gpincheiraa
Created September 23, 2017 06:21
Show Gist options
  • Save gpincheiraa/ead6f4f7140013554edd910aa50807e1 to your computer and use it in GitHub Desktop.
Save gpincheiraa/ead6f4f7140013554edd910aa50807e1 to your computer and use it in GitHub Desktop.
todoList.component.js_1_2nd_article
class TodoListController {
addTodo(todo){
this.todosList.push(todo)
}
toggleCheckTodo(index){
this.todosList[index].completed = !this.todosList[index].completed
}
deleteTodo(index){
this.todosList.splice(index, 1)
}
}
export const TodoListComponent = {
templateUrl: '/components/todoList.component.html',
controller: TodoListController,
bindings: {
todosList: "<"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment