5
을 저장하기 전에 새 pushid을 가져옵니다angularfire2는 데이터베이스에 저장하기 전에 기록 pushid를 검색 할 수 있었다 <code>angulafire</code>으로 모델 객체
myModelDto.key = dbRef.push().key;
// Add the myModelDto to the relative colletion
내가의 속성과 중포 기지 키를 저장할 수 있기 때문에이 편리이었다 내 모델.
지금 angularfire2
으로 이것은 청소/간단한 방법으로 가능하지 않는 것 :
constructor(private angFire: AngularFire) {
this.placeRef$ = angFire.database.list('/places');
}
insertPlace = (place: IPlace): firebase.Thenable<IPlace> => {
return this.placeRef$.push(place)
.then(item => {
place.id = item.key;
this.placeRef$.update(item.key, place)
});
(핵심 속성이 내 모델에 바인딩이하고자하는 편의성) 또는 새로 추가 된 레코드에 pushid를 추가하는 더 좋은 방법이 있는지 확인하십시오.