ngx-typeahead icon indicating copy to clipboard operation
ngx-typeahead copied to clipboard

How to handle http post request with ngx-typeahead?

Open fahadsubzwari924 opened this issue 4 years ago • 2 comments

All demos and examples of ngx-typahead are just using the same google search example or static json which is not usefull for most of the case.

I am implementing the same example of documentation like this component.html

<div class="search-results">
  <input
    [value]="search"
    ngxTypeahead
    [taUrl]="url"
    [taParams]="params"
    (taSelected)="handleResultSelected($event)"
  />
</div>`

component.ts

public url = "http://suggestqueries.google.com/complete/search";
  public params = {
   hl: "en",
   ds: "yt",
   xhr: "t",
   client: "youtube",
   q: query,
};

So can anyone make me understand that how this is working? how typed text term is passing to the api and how results showing in the template. And i have to call http post with a body so how can i do that? any example any guide?

fahadsubzwari924 avatar May 03 '21 19:05 fahadsubzwari924

hi @fahadsubzwari924 review https://github.com/orizens/ngx-typeahead#supported-api and try taApi and taApiMethod with taParams as the parameters object. look at the source code https://github.com/orizens/ngx-typeahead/blob/master/projects/ngx-typeahead/src/lib/ngx-typeahead.component.ts#L273

orizens avatar May 03 '21 20:05 orizens

Yes i saw these links. But i still didn't get that how searched/types keyword is passing into api to get search results? can you tell me that?

On Tue, 4 May 2021 at 01:40, Oren Farhi @.***> wrote:

hi @fahadsubzwari924 https://github.com/fahadsubzwari924 review https://github.com/orizens/ngx-typeahead#supported-api and try taApi and taApiMethod with taParams as the parameters object. look at the source code https://github.com/orizens/ngx-typeahead/blob/master/projects/ngx-typeahead/src/lib/ngx-typeahead.component.ts#L273

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/orizens/ngx-typeahead/issues/52#issuecomment-831519734, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGQGGBN6O7ZBRCGENBDVND3TL4C2VANCNFSM44BLSOAA .

fahadsubzwari924 avatar May 03 '21 20:05 fahadsubzwari924