Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions AngularApp/src/app/shared/employee.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,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';

Comment on lines 1 to 16

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.

Expand Down