내 firebase db에서 가져온 객체를 사용하는 데 문제가 있습니다. 아래 그림에서 볼 수 있듯이 json 파일을 아무런 문제없이 수신 할 수 있습니다. https://i.gyazo.com/6c1c69aca47f92a4e1029bb019042ab2.pngFirebase angularfire2 데이터베이스에서 객체 가져 오기
<h1>{{ item | async | json}}</h1>
상기 코드는이 /src/app/app.component.ts에서 항목 객체를 접수에
, /src/app/app.component.html에
import { Component } from '@angular/core';
import { AngularFire, FirebaseObjectObservable } from 'angularfire2';
@Component({
moduleId: module.id,
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css']
})
export class AppComponent {
item: FirebaseObjectObservable<any>;
constructor(af: AngularFire) {
this.item = af.database.object('/releases/');
}
}
또한 item.name. $ value를 사용해 보았지만 작동하지 않습니다. json 파일에서 값을 가져 오려고합니다. 웹 사이트에서 사용할 수 있습니다.
그것은 저에게 효과적이지만 유일한 것은 '@ angle/common'패키지에서 CommonModule을 추가로 가져온 것입니다. –