service .ts
get_update(id:any): Observable<any[]>{
let headers = new Headers({ 'Content-Type': 'application/json'});
let options = new RequestOptions({ headers: headers });
return this.http.get('http://localhost:8000/vendor/'+id,options)
.map(response => response.json())
.catch(error => Observable.throw(error.statusText));
}
component.ts
ngOnInit()
{ this.service.get_update(this.user).subscribe(data => console.log(data));
}
I want to store data in to another variable and i want to convert into Global Variable