Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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