title: Uncaught TypeError: this.source is not a function
body: <p>I want to prelaod all the customers and give it to the autocomplete whenever needed. I have this error caught up. The group search is global across the application.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
       $(document).ready(function() {
           var customers = $.ajax({
               url: "http://localhost:8081/customers/all",
               type: 'GET',
               dataType: 'json',
               success: function (data) {
                   $.map(data, function (v, i) {
                       return {
                           number: v.number,
                           name : v.name,
                       };
                   });
               }
           });
  
           $("#customer-search").autocomplete({
               minLength: 0,
               source: customers,
               select: function( event, ui ) {
                   $( "#group-search" ).val(ui.item.name);
                   $("#group-search-form").submit();
                   return false;
               },
           }).autocomplete( "instance" )._renderItem = function( ul, item ) {
               return $( "&lt;li&gt;" )
                   .append( "&lt;div&gt;" + item.name + " " + item.number + "&lt;/div&gt;" )
                   .appendTo( ul );
           };
  
  
  
  
  
       });
   &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>