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.
72 ngOnChanges() { 73 this.__options.next(this.options); 74 }
217 ngAfterViewInit(): void { 218 this._cd.detectChanges(); 219 }
36 public get ngModelChange() { 37 return this.selectedOptionChange; 38 }
38 changedSelect(obj) { 39 this.select.emit(obj); 40 }
115 ngAfterContentInit() { 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 }
540 public selectValue(value: any): void { 541 if (this.dropdown) { 542 this.ngZone.runOutsideAngular(() => { 543 this.dropdown.selectValue(value); 544 }); 545 } 546 }
23 public selectChange(selectedItem: any) { 24 console.log("select city is:" + selectedItem.label); 25 this.selectedCityName = selectedItem.label; 26 }
258 ngAfterContentInit(): void { 259 this._valueChangeSub = this.selectList.valueChange.subscribe(() => { 260 this.cdRef.markForCheck(); 261 this.stateChangedEmitter.next(); 262 }); 263 }
191 private 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 }
70 onSelect(value) { 71 this.select.emit(value); 72 }