2
我要插入我的數據在火力,像這樣:Angular-firebase。數據未正確插入
cities:{
Tokyo:{
name: "Tokyo, JP"
}
London:{
name: "London, UK"
}
and so on...
我手動一些數據插入從網上GUI:cities
但不幸的是它被插入這樣:minsk
我的代碼
的火力地堡工廠:
export default function CitiesFactory($firebaseArray, Firebase) {
'ngInject';
var ref = new Firebase("https://name.firebaseio.com/");
return $firebaseArray(ref.child('cities'));
}
控制器(添加功能):
$scope.addoras = function(city) {
CitiesFactory.$add({
city: {
name: city
}
}).then(function(CitiesFactory) {
var id = CitiesFactory.key();
console.log('Added Contact ' + id);
$scope.addorasmodel = '';
});
};
有人能幫助我嗎?
另見http://stackoverflow.com/questions/36845390/firebase-help-avoid -new-id-on-new-push/36846118#36846118 –