本文整理汇总了TypeScript中firebase/angularfire.FirebaseArray类的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseArray类的具体用法?TypeScript FirebaseArray怎么用?TypeScript FirebaseArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FirebaseArray类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: clearCompleted
clearCompleted() {
var toClear = {};
this.todoService.list.forEach((todo) => {
if(todo.completed) {
toClear[todo._key] = null;
}
});
this.todoService.bulkUpdate(toClear);
}
示例2: doneEditing
doneEditing($event, todo) {
var which = $event.which;
var target = $event.target;
if(which === 13) {
todo.title = target.value;
this.todoService.save(todo);
this.todoEdit = null;
} else if (which === 27) {
this.todoEdit = null;
target.value = todo.title;
}
}
示例3: addTodo
addTodo($event, newTodo){
if($event.which === 13) {
this.todoService.add({
title: newTodo.value,
completed: false
});
newTodo.value = '';
}
}
示例4: clearChecked
clearChecked(){
var toClear = {};
this.todoService.list.forEach(todo => {
if(todo.completed) {
toClear[todo._key] = null;
}
});
this.todoService.bulkUpdate(toClear);
this.bulkCheckState = false;
}
示例5:
this.todoService.list.forEach((todo)=> {
todo.completed = isComplete;
this.todoService.save(todo);
});
示例6: deleteMe
deleteMe(todo) {
this.todoService.remove(todo);
}
示例7: completeMe
completeMe(todo) {
todo.completed = !todo.completed;
this.todoService.save(todo);
}
示例8: addTodo
addTodo(newTitle) {
this.todoService.add({
title: newTitle,
completed: false
});
}
示例9: removeTodo
removeTodo(todo){
this.todoService.remove(todo);
}
示例10: toggleCheck
toggleCheck(todo){
todo.completed = !todo.completed;
this.todoService.save(todo);
}