更新firebase值的correct
方法是什么?它是使用firebase文件?据我所知,在polymerfire中,已被弃用。但是,在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数据库。