-
-
Save gavilanch/4cd5aaccef70243a4532ef73204dd01f 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
todos: TodoViewModel[] = []; | |
loadTodos() { | |
this.todoService.getTodos().subscribe(response => { | |
this.todos = []; | |
response.docs.forEach(value => { | |
const data = value.data(); | |
const id = value.id; | |
const todo: TodoViewModel = { | |
id: id, | |
title: data.title, | |
description: data.description, | |
done: data.done, | |
lastModifiedDate: data.lastModifiedDate.toDate() | |
}; | |
this.todos.push(todo); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment