Convert Observable<any> to Observable<customtype> in angular2, typescript

Discussão em 'Angular' iniciado por lintu, Dezembro 28, 2024.

  1. lintu

    lintu Guest

    How can we convert between types in typescript? like Observable <any> to Observable<array of custom_type>. Do we need to use map function to map each value in incoming item of list or is there some other typecasting mechanism?

    sample code

    private list: Observable<any>;
    this.list = af.database.list('/list/') //af: AngularFire

    Continue reading...

Compartilhe esta Página