Recipe - Food - Nutrition

부분 유료
Verified
분류별 David | 업데이트됨 25 days ago | Food
인기

9.9 / 10

지연 시간

1,479ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

autocomplete recipe search

Rapid account: Deesmateen
deesmateen
7 years ago

I have a simple question. I am building an app in Angular 2, I am a bit green and I am not sure how to get this implemented with the structure of the GET request on the autocomplete recipe search, how can I use an input to type a food, like chicken, and have that GET the recipes for it? I have it working on the page load and it populates the data when I put the url in with the query that already has chicken in it from the example, but I would like to have that happen on the submit button click with the food they have typed in the input.

Rapid account: Spoonacular
spoonacular Commented 7 years ago

Hi,

I’m not really sure whether I understand your questions completely but I give it a shot.

So you want to search for recipes with the text that the user has typed in the input?

<input id=“query” value=“chicken”>

You would grab that input, e.g. with jquery $(’#query’).val() and take add that to the search query after the query parameter when the user presses enter. You than capture the response and show the recipes.

Not sure whether I hit your use case, maybe another user can jump in to help?

Best,
David

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입