-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d05fd4
commit f9130b6
Showing
10 changed files
with
68 additions
and
38 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
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 was deleted.
Oops, something went wrong.
Empty file.
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,7 @@ | ||
<h2>8. Value changed</h2> | ||
<ng-select2 [data]="exampleData" | ||
[ngModel]="test" | ||
(valueChanged)="valueChanged($event)" | ||
(ngModelChange)="modelChanged($event)" | ||
[width]="300"> | ||
</ng-select2> |
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,42 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { Select2OptionData } from 'ngSelect2'; | ||
|
||
@Component({ | ||
selector: 'app-value-changed', | ||
templateUrl: './value-changed.component.html', | ||
styleUrls: ['./value-changed.component.css'] | ||
}) | ||
export class ValueChangedComponent implements OnInit { | ||
public test = 'value-changed-1'; | ||
public exampleData: Array<Select2OptionData>; | ||
|
||
ngOnInit() { | ||
this.exampleData = [ | ||
{ | ||
id: 'value-changed-1', | ||
text: 'Value changed 1' | ||
}, | ||
{ | ||
id: 'value-changed-2', | ||
disabled: true, | ||
text: 'Value changed 2' | ||
}, | ||
{ | ||
id: 'value-changed-3', | ||
text: 'Value changed 3' | ||
}, | ||
{ | ||
id: 'value-changed-4', | ||
text: 'Value changed 4' | ||
} | ||
]; | ||
} | ||
|
||
public valueChanged(event: string) { | ||
console.log('value changed: ' + event); | ||
} | ||
|
||
public modelChanged(event: string) { | ||
console.log('model changed: ' + event); | ||
} | ||
} |