PRIYANSHI
PRIYANSHI

Reputation: 85

Typescript : error TS1109: Expression expected

  getItems(){  
      return.this._http.get('http://localhost/api/items').map(res=>res.json());
  };

This error is coming in this simple code. Kindly tell me any fix of it. Thanks!

Upvotes: 1

Views: 11593

Answers (1)

adiga
adiga

Reputation: 35202

Remove the "." after return

getItems() {  return this._http.get('http://localhost/api/items').map(res => res.json()) };

Upvotes: 4

Related Questions