How to return object from service to component in angular
问题 I want to access particular json in ngOninit. So i have id on click in edit button and with the help of that id i am getting complete object from database like form name , form json which etc. So from the service i want to return that json to ngOninit. Here is service. GetFormById (id: number) { return this.httpClient.get<FormTemplate[]>(this.API_URL + "GetFormTemplate/" + id).subscribe(data => { console.log(data); return data; }); } In console i am getting complete object from database which