I have a service that gets a json from http
I created a dialog for errors in my main app, but I dont understand how you give back the potential error to the applicationi so it displays it on the web page
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
@Injectable()
export class TranslateService
{
constructor(private http:Http)
{
this.http.get("some.json").map(res => res.json())
.subscribe(
res =>
{
....
},
error =>
{
console.log(error); <<<< how to give this error to the main application component ?
},
);
}
}
thanks