Physics, asked by kanikachaudary8113, 1 year ago

Ror ts2339: property 'subscribe' does not exist on type 'void'.

Answers

Answered by Shaizakincsem
6

Thank you for asking this question. Here is your answer:

You are not returning the observable in your getLoginData function. Add the return keyword and optionally add the return type to the signature:

getLoginData(): Observable<any>{

   return this.http.get('./json/login.json')

     .map((result: Response) => result.json())

     .catch(this.getError);

 }

If there is any confusion please leave a comment below.

Similar questions