'Error' message: 'Property 'from' does not exist on type 'typeof Observable'

前端 未结 2 1276
广开言路
广开言路 2021-02-20 00:08

I am trying to learn reactive programming using RxJS. I was trying to create an observable from an array using Observable.from() method, but I am getting an err

2条回答
  •  余生分开走
    2021-02-20 00:26

    Change

    import { Observable} from 'rxjs/Observable'
    import 'rxjs/observable/from'
    

    To

    import { Observable } from 'rxjs/Observable';
    import 'rxjs/add/observable/from';
    

提交回复
热议问题