10 examples of 'angular select on change' in JavaScript

Every line of 'angular select on change' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
72ngOnChanges() {
73 this.__options.next(this.options);
74}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

217ngAfterViewInit(): void {
218 this._cd.detectChanges();
219}
36public get ngModelChange() {
37 return this.selectedOptionChange;
38}
38changedSelect(obj) {
39 this.select.emit(obj);
40}
115ngAfterContentInit() {
116 let defaultOption: OptionComponent;
117 this.options.forEach((option: OptionComponent, index: number) => {
118 if (option.selected) {
119 defaultOption = option;
120 this.selectedIndex = index;
121 }
122 });
123 if (!defaultOption) {
124 defaultOption = this.options.toArray()[this.selectedIndex];
125 }
126 if (!defaultOption) {
127 defaultOption = this.options.first;
128 this.selectedIndex = 0;
129 }
130 if (defaultOption) {
131 this.value = defaultOption.value;
132 defaultOption.selected = true;
133 this.defaultOption = defaultOption;
134 }
135}
540public selectValue(value: any): void {
541 if (this.dropdown) {
542 this.ngZone.runOutsideAngular(() => {
543 this.dropdown.selectValue(value);
544 });
545 }
546}
23public selectChange(selectedItem: any) {
24 console.log("select city is:" + selectedItem.label);
25 this.selectedCityName = selectedItem.label;
26}
258ngAfterContentInit(): void {
259 this._valueChangeSub = this.selectList.valueChange.subscribe(() => {
260 this.cdRef.markForCheck();
261 this.stateChangedEmitter.next();
262 });
263}
191private notifyModelChanged(selectedValue: any) {
192 if (!selectedValue) {
193 this.propagateChange(null);
194 } else if (this.bindValue) {
195 this.propagateChange(selectedValue[this.bindValue]);
196 } else {
197 this.propagateChange(selectedValue);
198 }
199}
70onSelect(value) {
71 this.select.emit(value);
72}

Related snippets