kolkov / ngx-dadata

Angular 6+ and 13+ DaData suggestion (подсказки) service implementation
MIT License
12 stars 14 forks source link

Wrong service request or missing information in README? #15

Open WuglyakBolgoink opened 4 years ago

WuglyakBolgoink commented 4 years ago

Hallo @kolkov

if I use jQuery example, then this work fine!

$("#address").suggestions({
  // Замените на свой API-ключ
  token: "7fd18aaabd7d53ffa4846e4521c1f736c13490eb",
  type: "ADDRESS",
  geoLocation: false,
  constraints: {
    locations: { country: "*" },
    label: ""
  }
});

if I use same config with angular component I got only russian addresses, because...

request in jQuery:

{
  "locations": [
    {
      "country": "*"
    }
  ],
  "restrict_value": false,
  "from_bound": {
    "value": "country"
  },
  "to_bound": {
    "value": "country"
  },
  "query": "ber",
  "count": 5,
  "language": "en"
}

request in ngx-dadata component:

{
  "query": "ber"
}

why we have this different?