title: Custom Auto-complete Angular-Material
body: <h2>Background</h2>
  
  <p>I am using <a href="https://material.angularjs.org/latest/" rel="nofollow noreferrer">Angular Material</a>, and I want to do a custom auto-complete inspired in the <a href="https://material.angularjs.org/latest/demo/autocomplete" rel="nofollow noreferrer">custom auto-complete</a> example they provide.</p>
  
  <h2>Problem</h2>
  
  <p>The exact result that I want is the following:</p>
  
  <p><img src="https://i.stack.imgur.com/YbInA.png" alt="desired_output"></p>
  
  <p>However, this is what I am getting:</p>
  
  <p><img src="https://i.stack.imgur.com/QRPjc.png" alt="current_output"></p>
  
  <p>The problem is that no matter what I do, my list of items is never shows correctly !</p>
  
  <h2>What I tried</h2>
  
  <p>To achieve this I read several tutorials, and I managed to piece together the following HTML code:</p>
  
  <p>index.html:</p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;Custom-Complete&lt;/title&gt;
  
      &lt;!--CSS files--&gt;
      &lt;link rel="stylesheet" href="../node_modules/angular-material/angular-material.min.css"&gt;
  &lt;/head&gt;
  
  &lt;body ng-app="MyApp" ng-cloak&gt;
  
      &lt;div ng-controller="DemoCtrl as ctrl" layout="column" ng-cloak="" class="autocompletedemoCustomTemplate" ng-app="MyApp"&gt;
          &lt;md-content layout-padding="" layout="column"&gt;
              &lt;form ng-submit="$event.preventDefault()"&gt;
  
                  &lt;md-autocomplete md-selected-item="ctrl.selectedItem" md-search-text-change="ctrl.searchTextChange(ctrl.searchText)" md-search-text="ctrl.searchText" md-selected-item-change="ctrl.selectedItemChange(item)" md-items="item in ctrl.querySearch(ctrl.searchText)"
                      md-item-text="item.Company_Name" md-min-length="0" placeholder="Write client Info" md-menu-class="autocomplete-custom-template"&gt;
                      &lt;md-item-template&gt;
  
                          &lt;span class="item-title"&gt;
                              &lt;b&gt;Company name:&lt;/b&gt; {{item.Company_Name}}
                          &lt;/span&gt;
  
                          &lt;span class="item-metadata"&gt;
                              &lt;b&gt;Client Ids:&lt;/b&gt;
                              &lt;span ng-repeat="clientId in item.Assets"&gt;
                                  &lt;span class="item-metastat"&gt;
                                      &amp;emsp;&lt;ng-md-icon icon="subdirectory_arrow_right" style="fill: gray" size="24"&gt;&lt;/ng-md-icon&gt;{{clientId}}
                                  &lt;/span&gt;
                              &lt;/span&gt;
                          &lt;/span&gt;
                      &lt;/md-item-template&gt;
                  &lt;/md-autocomplete&gt;
              &lt;/form&gt;
          &lt;/md-content&gt;
      &lt;/div&gt;
  
      &lt;!-- Angular Material requires Angular.js Libraries --&gt;
      &lt;script src="../node_modules/angular/angular.min.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular-aria/angular-aria.min.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular-animate/angular-animate.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-114/svg-assets-cache.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular-material/angular-material.min.js"&gt;&lt;/script&gt;
      &lt;script src="../node_modules/angular-material-icons/angular-material-icons.min.js"&gt;&lt;/script&gt;
  
      &lt;!-- Your application bootstrap  --&gt;
      &lt;script type="text/javascript" src="js/autocomplete.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I guess that my problem is that I don't know which HTML tags I need to use, nor how I need to use them!</p>
  
  <h2>Extra Info</h2>
  
  <p>These are the libraries I am using and their versions (Specially important, is the version of <strong>Angular Material - v1.0.9</strong>):</p>
  
  <pre><code>"angular": "^1.5.6",
  "angular-animate": "^1.5.6",
  "angular-aria": "^1.5.6",
  "angular-material": "^1.0.9"
  "angular-messages": "^1.5.6",
  "express": "^3.2.6"
  </code></pre>
  
  <h2>Question</h2>
  
  <ul>
  <li>What is wrong in my code, and how can I fix it?</li>
  </ul>
  
  <hr>
  
  <h2>Solution</h2>
  
  <p>After the answers provided here, I finally updated my github repository. 
  If you think this is something you would like to have, feel free to clone it and give it a look !</p>
  
  <ul>
  <li><a href="https://github.com/Fl4m3Ph03n1x/custom-complete" rel="nofollow noreferrer">https://github.com/Fl4m3Ph03n1x/custom-complete</a></li>
  </ul>
  
  <p>Thanks for the help!</p>