Skip to content

Commit

Permalink
fix: demo custom templates
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao committed Mar 13, 2018
1 parent 3311f8c commit 32c4b25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 3 additions & 5 deletions demo/app/examples/custom-templates.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ import { distinctUntilChanged, debounceTime, switchMap } from 'rxjs/operators'
---
<p>
Selected people: {{selectedPeople}}
</p
</p>
<label>Custom not found , type to search and loading </label>
<label>Custom not found, type to search and loading </label>
---html,true
<ng-select
[multiple]="true"
Expand All @@ -107,15 +107,13 @@ import { distinctUntilChanged, debounceTime, switchMap } from 'rxjs/operators'
</div>
</ng-template>
<ng-template ng-notfound-tmp let-searchTerm="searchTerm">
<div class="ng-option disabled">
No data found for "{{searchTerm}}"
</div>
</ng-template>
<ng-template ng-loadingtext-tmp let-searchTerm="searchTerm">
<div class="ng-option disabled">
Fetching Data for "{{searchTerm}}"
Fetching data for "{{searchTerm}}"
</div>
</ng-template>
</ng-select>
Expand Down
9 changes: 4 additions & 5 deletions src/ng-select/ng-select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

<ng-template
[ngTemplateOutlet]="notFoundTemplate || defaultNotfoundTemplate"
[ngTemplateOutletContext]="{searchTerm: filterValue }">
[ngTemplateOutletContext]="{ searchTerm: filterValue }">
</ng-template>
</ng-container>

Expand All @@ -102,19 +102,18 @@
</ng-template>

<ng-template
[ngTemplateOutlet]="typeToSearchTemplate || defaultTypeToSearchTemplate"
[ngTemplateOutletContext]="{ searchTerm: filterValue }">
[ngTemplateOutlet]="typeToSearchTemplate || defaultTypeToSearchTemplate">
</ng-template>
</ng-container>

<ng-container *ngIf="isLoading && itemsList.filteredItems.length === 0">
<ng-template #defaultLoadingTextTemplate>
<div class="ng-option disabled" [innerHTML]="loadingText" ></div>
<div class="ng-option disabled" [innerHTML]="loadingText"></div>
</ng-template>

<ng-template
[ngTemplateOutlet]="loadingTextTemplate || defaultLoadingTextTemplate"
[ngTemplateOutletContext]="{ isearchTerm: filterValue }">
[ngTemplateOutletContext]="{ searchTerm: filterValue }">
</ng-template>
</ng-container>

Expand Down

0 comments on commit 32c4b25

Please sign in to comment.