Skip to content

Instantly share code, notes, and snippets.

@anjmao
Created November 23, 2017 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anjmao/a5e7f637f226880a71b1dd4cca3a8b2b to your computer and use it in GitHub Desktop.
Save anjmao/a5e7f637f226880a71b1dd4cca3a8b2b to your computer and use it in GitHub Desktop.
<h3>Multiselect example with custom template and typeahead</h3>
<pre>
<code class="html">
&lt;ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount"&gt;
&lt;ng-template ng-option-tmp let-item="item"&gt;
&lt;img [src]="item.avatar_url" width="20px" height="20px"&gt; {{item.login}}
&lt;/ng-template&gt;
&lt;/ng-select&gt;
</code>
</pre>
<ng-select [items]="items"
notFoundText="No results found"
typeToSearchText="Search for github account"
bindLabel="login"
[placeholder]="placeholder"
[multiple]="multiple"
[typeahead]="typeahead"
[(ngModel)]="githubAccount">
<ng-template ng-option-tmp let-item="item">
<img [src]="item.avatar_url" width="20px" height="20px"> {{item.login}}
</ng-template>
</ng-select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment