Created
March 20, 2019 12:09
-
-
Save malakhov-dmitrii/4890ebb80f12527758bb26d893d39ca7 to your computer and use it in GitHub Desktop.
This file contains 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 TodoComponent implements OnInit { | |
constructor(private _store: Store<State>) { } | |
ngOnInit() { | |
} | |
createTodo() { | |
// Или любой другой способ задать значения :) | |
let todo: Todo = { | |
id: 1, | |
userId: 1, | |
completed: false, | |
title: 'Lorem ipsum dolor amet' | |
}; | |
this._store.dispatch(new AddNewTodo(todo)) | |
} | |
editTodo(id) { | |
this._store.dispatch(new EditTodo(id)) | |
} | |
removeTodo(id) { | |
this._store.dispatch(new RemoveTodo(id)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment