Property 'pipe' does not exist on type 'AngularFireObject<{}>'

后端 未结 6 1577
一生所求
一生所求 2021-01-03 17:00

I\'m a beginner to Angular. I\'m watching the tutorial of Mosh Hamedani using the Angular version 6 but the problem is the tutorial version is 4. I\'m working on the e-comme

6条回答
  •  猫巷女王i
    2021-01-03 17:10

    As the time of writing this answer, In AngularFireObject you have to use either valueChanges() or snapshotChanges(). You can read the documentation here

    Coming to your concern if you simply modify your code from

    item$.pipe(take(1)).subscribe(item => {})
    

    to

    item$.valueChanges().pipe(take(1)).subscribe(item => {})
    

    will solve your problem.

提交回复
热议问题