Tôi đang theo dõi this tutorial về cách kết nối góc với cơ sở dữ liệu firebase. Nhưng trong phút 17:30 Tôi nhận được lỗi này:Thuộc tính AngularFIRE 'đăng ký' không tồn tại trên loại 'AngularFireList <{}>'
tài sản 'đăng ký' không tồn tại trên loại 'AngularFireList < {}>'
AppComponent tôi:
import { Component } from '@angular/core';
import {AngularFireDatabase, AngularFireDatabaseModule} from 'angularfire2/database';
import {AngularFireAuth, AngularFireAuthModule} from 'angularfire2/auth';
import { Observable } from 'rxjs/Observable';
import * as firebase from 'firebase/app';
import { Country } from './models/country';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
countries: any[];
constructor(db: AngularFireDatabase)
{
db.list('/Country/countries')
.subscribe(countries => { // <--ERROR IS HERE
this.countries = countries;
console.log(this.countries);
});
}
}
My mô hình:
export class Country {
// --ATTRIB--
id: string;
name: string;
code: string;
urlFlag: string;
}
Không tìm thấy bất kỳ điều gì về lỗi này. Tôi là người mới bắt đầu ở góc độ. Cảm ơn nếu có thể giúp tôi.
"cập nhật hoạt động!" ; D –