correct
更新firebase值的方法是什么?是使用firebase-document吗?我知道在聚合物火中,已被弃用。但是,在 https://github.com/PolymerLabs/todo-list中,我可以像这样简单地更新集合:
<firebase-collection location="{{userLocation}}" data="{{fbTodos}}"
on-firebase-value="_firebaseLoaded">
</firebase-collection>
_firebaseLoaded: function() {
this._firebaseConnected = true;
this.todos = this.fbTodos;
this.backupTodos = this.fbTodos;
this.linkPaths('fbTodos', 'todos');
this.linkPaths('backupTodos', 'todos');
},
……
deleteTodo: function(e) {
this.arrayDelete('todos', e.detail.todo);
},
更新firebase db的正确方法是什么?顺便说一句,有什么作用this.linkPaths
?如果没有linkPaths
,则不会更新 firebase 数据库。