forked from valor-software/ngx-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(typehead): add demo for typeaheadOnSelect output valor-software#…
…3681 Add demo for typeaheadOnSelect output Close valor-software#3681
- Loading branch information
1 parent
465ed0d
commit 2cbe119
Showing
15 changed files
with
119 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
demo/src/app/components/+typeahead/demos/grouping/grouping.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
demo/src/app/components/+typeahead/demos/on-select/on-select.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<pre class="card card-block card-header mb-3">Model: {{selectedValue | json}}</pre> | ||
<pre class="card card-block card-header mb-3">Selected option: {{selectedOption | json}}</pre> | ||
|
||
<input [(ngModel)]="selectedValue" | ||
[typeahead]="states" | ||
typeaheadOptionField="name" | ||
(typeaheadOnSelect)="onSelect($event)" | ||
class="form-control"> |
66 changes: 66 additions & 0 deletions
66
demo/src/app/components/+typeahead/demos/on-select/on-select.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-typeahead-on-select', | ||
templateUrl: './on-select.html' | ||
}) | ||
export class DemoTypeaheadOnSelectComponent { | ||
selectedValue: string; | ||
selectedOption: any; | ||
states: any[] = [ | ||
{ id: 1, name: 'Alabama', region: 'South' }, | ||
{ id: 2, name: 'Alaska', region: 'West' }, | ||
{ id: 3, name: 'Arizona', region: 'West' }, | ||
{ id: 4, name: 'Arkansas', region: 'South' }, | ||
{ id: 5, name: 'California', region: 'West' }, | ||
{ id: 6, name: 'Colorado', region: 'West' }, | ||
{ id: 7, name: 'Connecticut', region: 'Northeast' }, | ||
{ id: 8, name: 'Delaware', region: 'South' }, | ||
{ id: 9, name: 'Florida', region: 'South' }, | ||
{ id: 10, name: 'Georgia', region: 'South' }, | ||
{ id: 11, name: 'Hawaii', region: 'West' }, | ||
{ id: 12, name: 'Idaho', region: 'West' }, | ||
{ id: 13, name: 'Illinois', region: 'Midwest' }, | ||
{ id: 14, name: 'Indiana', region: 'Midwest' }, | ||
{ id: 15, name: 'Iowa', region: 'Midwest' }, | ||
{ id: 16, name: 'Kansas', region: 'Midwest' }, | ||
{ id: 17, name: 'Kentucky', region: 'South' }, | ||
{ id: 18, name: 'Louisiana', region: 'South' }, | ||
{ id: 19, name: 'Maine', region: 'Northeast' }, | ||
{ id: 21, name: 'Maryland', region: 'South' }, | ||
{ id: 22, name: 'Massachusetts', region: 'Northeast' }, | ||
{ id: 23, name: 'Michigan', region: 'Midwest' }, | ||
{ id: 24, name: 'Minnesota', region: 'Midwest' }, | ||
{ id: 25, name: 'Mississippi', region: 'South' }, | ||
{ id: 26, name: 'Missouri', region: 'Midwest' }, | ||
{ id: 27, name: 'Montana', region: 'West' }, | ||
{ id: 28, name: 'Nebraska', region: 'Midwest' }, | ||
{ id: 29, name: 'Nevada', region: 'West' }, | ||
{ id: 30, name: 'New Hampshire', region: 'Northeast' }, | ||
{ id: 31, name: 'New Jersey', region: 'Northeast' }, | ||
{ id: 32, name: 'New Mexico', region: 'West' }, | ||
{ id: 33, name: 'New York', region: 'Northeast' }, | ||
{ id: 34, name: 'North Dakota', region: 'Midwest' }, | ||
{ id: 35, name: 'North Carolina', region: 'South' }, | ||
{ id: 36, name: 'Ohio', region: 'Midwest' }, | ||
{ id: 37, name: 'Oklahoma', region: 'South' }, | ||
{ id: 38, name: 'Oregon', region: 'West' }, | ||
{ id: 39, name: 'Pennsylvania', region: 'Northeast' }, | ||
{ id: 40, name: 'Rhode Island', region: 'Northeast' }, | ||
{ id: 41, name: 'South Carolina', region: 'South' }, | ||
{ id: 42, name: 'South Dakota', region: 'Midwest' }, | ||
{ id: 43, name: 'Tennessee', region: 'South' }, | ||
{ id: 44, name: 'Texas', region: 'South' }, | ||
{ id: 45, name: 'Utah', region: 'West' }, | ||
{ id: 46, name: 'Vermont', region: 'Northeast' }, | ||
{ id: 47, name: 'Virginia', region: 'South' }, | ||
{ id: 48, name: 'Washington', region: 'South' }, | ||
{ id: 49, name: 'West Virginia', region: 'South' }, | ||
{ id: 50, name: 'Wisconsin', region: 'Midwest' }, | ||
{ id: 51, name: 'Wyoming', region: 'West' } | ||
]; | ||
|
||
onSelect(event: any): void { | ||
this.selectedOption = event.item; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
demo/src/app/components/+typeahead/demos/scrollable/scrollable.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<pre class="card card-block card-header">Model: {{selected | json}}</pre> | ||
<pre class="card card-block card-header mb-3">Model: {{selected | json}}</pre> | ||
<input [(ngModel)]="selected" | ||
[typeahead]="states" | ||
class="form-control"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters