小编P_J*_*_Js的帖子

Angular 4:InvalidPipeArgument:管道'AsyncPipe'的'[object Object]'

我需要你的帮助,我正试图从我的火力显示器中显示一些数据,但它却给我一个错误InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'.


有我的服务:

import { Injectable } from '@angular/core';
import { AngularFireDatabase } from 'angularfire2/database';

@Injectable()
export class MoviesService {

  constructor(private db: AngularFireDatabase) {}
  get = () => this.db.list('/movies');
}
Run Code Online (Sandbox Code Playgroud)

有我的组件:

import { Component, OnInit } from '@angular/core';
import { MoviesService } from './movies.service';

@Component({
  selector: 'app-movies',
  templateUrl: './movies.component.html',
  styleUrls: ['./movies.component.css']
})
export class MoviesComponent implements OnInit {
  movies: any[];

  constructor(private moviesDb: MoviesService) { }

  ngOnInit() {
    this.moviesDb.get().subscribe((snaps) => {
      snaps.forEach((snap) => {
        this.movies …
Run Code Online (Sandbox Code Playgroud)

pipe observable pug angularfire2 angular

38
推荐指数
4
解决办法
8万
查看次数

标签 统计

angular ×1

angularfire2 ×1

observable ×1

pipe ×1

pug ×1