Skip to content

Instantly share code, notes, and snippets.

@gpincheiraa
Last active September 28, 2017 03:55
Show Gist options
  • Save gpincheiraa/1f054301b0ad6768e2aa48ae01cddb88 to your computer and use it in GitHub Desktop.
Save gpincheiraa/1f054301b0ad6768e2aa48ae01cddb88 to your computer and use it in GitHub Desktop.
todoList.component.js- 4 First Impressions using jest for TDD over AngularJS > 1.5.x — Part I
export class TodoListController {
constructor(){
this.todosList = []
}
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 = {
controller: TodoListController
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment