Angular2 Observable and Promise

后端 未结 3 783
面向向阳花
面向向阳花 2021-02-02 07:01

I started using Angular2 Observable, but I can\'t find something similar to .then that I used with Promises.

This is what I want

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-02 07:58

    You need to import the Rx toPromise operator like

    import 'rxjs/add/operator/toPromise';
    

    Cheers!

提交回复
热议问题