Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Asynchronous search - mdb autocompleter getting error 'mdb' variable

iqitlab free asked 3 years ago


const asyncAutocomplete = document.querySelector('#async');
const asyncFilter = async (query) => { 
  const url = `https://swapi.py4e.com/api/people/?search=${encodeURI(query)}`; 
  const response = await fetch(url); 
  const data = await response.json();

  return data.results;
};

new mdb.Autocomplete(asyncAutocomplete, { 
  filter: asyncFilter, 
  displayValue: (value) => value.name
});

Grzegorz Bujański staff answered 3 years ago


Please clarify what version of MDB are you using? You specified MDB Angular version 12.0.0, but the code suggests that you are using MDB Standard version.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: MDB4 12.0.0
  • Device: MAC Book Pro
  • Browser: Chrome
  • OS: MAC OS
  • Provided sample code: No
  • Provided link: No