;
+ @Input('error-msg') public errorMessage: any = {};
+ @Input('validate')
+ get isValidate() { return this._isValidate; }
+ set isValidate(value) { this._isValidate = toBoolean(value); }
+ private _isValidate: boolean = false;
private selectElement: HTMLElement;
private popoverElement: HTMLElement;
directionUp = false;
diff --git a/src/e2e-app/app/select/select.component.html b/src/e2e-app/app/select/select.component.html
index e3a17a43..f61b94bf 100755
--- a/src/e2e-app/app/select/select.component.html
+++ b/src/e2e-app/app/select/select.component.html
@@ -8,15 +8,33 @@ Reactive form
-
-
-
- {{p.name}}
-
-
- ]]>
-
+
+
+
+ {{p.name}}
+
+
+ ]]>
+
+
+ with required validation
+
+
+
+
+
+
+ {{c.name}}
+
+
+ ]]>
+
autocomplete example
diff --git a/src/e2e-app/app/select/select.component.ts b/src/e2e-app/app/select/select.component.ts
index 16549c45..bba50369 100755
--- a/src/e2e-app/app/select/select.component.ts
+++ b/src/e2e-app/app/select/select.component.ts
@@ -8,7 +8,8 @@ import {
} from '@angular/router';
import {
FormGroup,
- FormControl
+ FormControl,
+ Validators
} from '@angular/forms';
@Component({
@@ -20,6 +21,8 @@ export class SelectDemo {
form: FormGroup;
personId: FormControl = new FormControl(1);
+ colorId: FormControl = new FormControl('',Validators.required);
+
people: any[] = [
{id: 1, name: 'Bryan Cranston'},
{id: 2, name: 'Aaron Paul'},
@@ -91,7 +94,8 @@ export class SelectDemo {
ngOnInit() {
this.form = new FormGroup({
- personId: this.personId
+ personId: this.personId,
+ colorId:this.colorId
});
this.arrayForm = new FormGroup({
@@ -115,6 +119,11 @@ export class SelectDemo {
.subscribe((value: any) => {
console.log('personId.valueChanges', value);
});
+
+ this.colorId.valueChanges
+ .subscribe((value: any) => {
+ console.log('colorId.valueChanges', value);
+ });
}
onChange(value: any) {