Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从2018年爱奥尼亚3号的firebase读取数据_Firebase_Firebase Realtime Database_Ionic3_Angularfire2 - Fatal编程技术网

如何从2018年爱奥尼亚3号的firebase读取数据

如何从2018年爱奥尼亚3号的firebase读取数据,firebase,firebase-realtime-database,ionic3,angularfire2,Firebase,Firebase Realtime Database,Ionic3,Angularfire2,任何人都可以帮助我从firebase检索数据,我不知道我做错了什么 这是我的ts文件 我无法获取使用subscribe的数据事件,我收到了相同的错误 import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; import { AngularFireDatabase, AngularFireList } from 'angularfire2/database'; import

任何人都可以帮助我从firebase检索数据,我不知道我做错了什么

这是我的ts文件

我无法获取使用subscribe的数据事件,我收到了相同的错误

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { AngularFireDatabase, AngularFireList } from 'angularfire2/database';
import { Observable } from 'rxjs/Observable';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
    menu_items: Observable<any[]>;
  constructor(public navCtrl: NavController,afDB: AngularFireDatabase) {
    this.menu_items = afDB.list('/menu/').valueChanges(); 
  }
}
我的依赖关系

我越来越像这样了


使用angularfire2的firebase的编码风格有一些变化,我也有同样的问题

这是解决办法

<ion-item *ngFor="let menu of menu_items | async">
                {{ menu.menu_price }}
        </ion-item>
import { AngularFireModule } from 'angularfire2';
import { AngularFireDatabaseModule } from 'angularfire2/database';

imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp),
    AngularFireModule.initializeApp(firebase_credential),
    AngularFireDatabaseModule
  ],
"@angular/animations": "5.2.9",
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/compiler-cli": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@ionic-native/core": "4.6.0",
    "@ionic-native/screen-orientation": "^4.6.0",
    "@ionic-native/splash-screen": "4.6.0",
    "@ionic-native/status-bar": "^4.6.0",
    "@ionic/storage": "2.1.3",
    "angularfire2": "^5.0.0-rc.9",
    "cordova-android": "6.3.0",
    "cordova-plugin-device": "^2.0.1",
    "cordova-plugin-ionic-keyboard": "^2.0.5",
    "cordova-plugin-ionic-webview": "^1.1.19",
    "cordova-plugin-screen-orientation": "^3.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.1",
    "cordova-plugin-whitelist": "^1.3.3",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "^5.0.3",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.8",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.20"
TypeError: Object(...) is not a function
    at SwitchMapSubscriber.project (http://localhost:8100/build/vendor.js:81649:76)
    at SwitchMapSubscriber._next (http://localhost:8100/build/vendor.js:66537:27)
    at SwitchMapSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20704:18)
    at RefCountSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20740:26)
    at RefCountSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20704:18)
    at Subject.next (http://localhost:8100/build/vendor.js:23191:25)
    at ConnectableSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20740:26)
    at ConnectableSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20704:18)
    at Notification.observe (http://localhost:8100/build/vendor.js:51804:50)
    at AsyncAction.DelaySubscriber.dispatch (http://localhost:8100/build/vendor.js:83939:40)