Skip to content

Conversation

@prntcena
Copy link

followed your tutorial and faced issue in " module not imported "rxjs"" . Got this fixed by these changes.

followed your tutorial and faced issue in " module not imported "rxjs"" . Got this fixed by these changes.
Comment on lines 1 to 16
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
//changes for latest rxjs imports as previous were not working
/*
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
*/
import { Observable } from 'rxjs';

import { map } from 'rxjs/operators';
import { toPromise } from 'rxjs/operators';

import { Employee } from './employee.model';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the latest version of rxjs, we dont need to import toPromise.js since it is included in the Observable itself.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still not working properly. when I insert this "import { toPromise } from 'rxjs/operators';" , toPromise has been underlined and
without these line " import { Observable } from 'rxjs';

import { map } from 'rxjs/operators';
import { toPromise } from 'rxjs/operators';"

or within these lines cannot load the web page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants