angular / in-memory-web-api

The code for this project has moved to the angular/angular repo. This repo is now archived.
MIT License
1.18k stars 231 forks source link

Get creates object #237

Open GrigoryTsuryev opened 5 years ago

GrigoryTsuryev commented 5 years ago

THis is my class

export class FakeMemoryDbImplService {

SERVER_URL: string = "http://localhost:8080/api/"; constructor(private httpClient: HttpClient) { }

public getLocations() : Observable<Location[]> { return this.httpClient.get<Location[]> (this.SERVER_URL + 'locations'); } }

and when i am trying to call it using

export class LocationComponent {

onLocationsDisplay() { this.dbservice.getLocations().subscribe((data: Location[]) => { console.log(data); }); } }

it creates me a new object. What could be the issue?