angular 2 : Cannot find name 'Response'

sahnoun

I got this error in angular 2 project :

Cannot find name 'Response'.

the problem came from this service :

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';


@Injectable()
export class CartographyService {

  public data;

  constructor(private http: Http) {
  }

  getData() {
    return this.http.get('http://localhost:8000/cartography')
      .map((res: Response) => res.json());

  }  
}
alehn96

Add this in the service

import { Http, Response } from '@angular/http';

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related