Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
234 views
in Technique[技术] by (71.8m points)

angular - What's the problem with this code in typescript?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
get(uri: string) {this.http.get(``${this.ROOT_URL}/${uri}``);}

should be

get(uri: string) {return this.http.get(`${this.ROOT_URL}/${uri}`);}

You need the return statement in the get method of your Webservice and there is a mistyping error: You have two `` instance of one.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...