When my json is coming from web api as wrapped in an object called "Devices" I cannot seem to get at the data with Angular 2 observable
This is a pic of the data in console
When I use a .json file without the Devices object wrapped it works fine...
If I call up a .json file then it works to display
private _productUrl = 'api/devices/devices.json';
But with this observable code i do not see where to add in .Devices
private _productUrl = 'http://localhost:42822/api/device';
constructor(private _http: Http) { }
getProducts(): Observable<IDevice[]> {//Observable<IProduct[]> {
return this._http.get(this._productUrl)
.map((response: Response) => <IDevice[]>response.json())
.do(data => console.log("All: " + JSON.stringify(data)))
.catch(this.handleError);
}