不确定我在这里做错了什么:
var eventDetails = new Event(key);
.factory("Event", ["$FirebaseObject", "$firebase",
function($FirebaseObject, $firebase, settings) {
var EventFactory = $FirebaseObject.$extendFactory({
});
return function(eventId) {
var ref = FIREBASE_REF.child('events/' + eventId);
var sync = $firebase(ref, {
objectFactory: EventFactory
});
return sync.$asObject(); // this will be an instance of UserFactory
}
}
])
eventDetails.$loaded(function(){
eventList.push(eventDetails);
});
eventList中的每个项都是$ id =同一个对象的对象,而不是$ id = some string。