尝试堆栈溢出的所有解决方案后,我的asyncpipe仍显示错误

时间:2018-01-05 08:56:11

标签: html angular

我的HTML

<mat-card fxLayout="column" fxLayoutAlign="none stretch">
    <div *ngFor="let post of postService.postsStream | async | reverse ">
        <app-post [post]=post></app-post>
        <hr>
    </div>
</mat-card>

我的post service.ts文件

import { Author } from '../models/author';

@Injectable()
export class PostService {

    readonly postsPath = "posts";
    private _postsStreamRef: AngularFireList<Post>;
    private _postsStream: Observable<Post[]>;


    constructor(private db: AngularFireDatabase,
        private authorService: AuthorService) {
        this._postsStreamRef = this.db.list(this.postsPath);

    }
    get postsStream(): AngularFireList<Post> {
        return this._postsStreamRef;
    }
    add(post: Post) {
        this._postsStreamRef.push(post);
    }

}

我试图在我的应用程序部分运行此显示后请帮我显示rror:InvalidPipeArgument:管道'AsyncPipe'的'[object Object]'。

0 个答案:

没有答案