Last active
September 28, 2017 03:55
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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