本文整理匯總了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);
}