0

I get this error in angular-cli when I import rxjs, and do not know what is the source of the problem.

angular-cli error

The path which I wrote is correct, double checked. I am new to the Angular, so feeling stuck. Here is the source code link https://github.com/EgomortIncognitus/bookstore

books.service.ts:

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator.map';

@Injectable()
export class BooksService {

  constructor(private http: Http) { }

  getAllBooks() {
    return this.http.get('data/books.json').map(res => res.json());
  }
}

2
  • pls post the import lines of books.service.ts Commented Jul 4, 2017 at 11:15
  • done, thank you in advance Commented Jul 4, 2017 at 11:21

1 Answer 1

3

I believe it should be import 'rxjs/add/operator/map'; not import 'rxjs/add/operator.map';

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, thank you. I presumed that it was some typo. Thanks again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.