10 examples of 'valuechanges angular2' in JavaScript

Every line of 'valuechanges angular2' 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
23_handleChangeEvent() {
24 this.handleChangeEvent(this.el.nativeElement, this.el.nativeElement.value);
25}
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

67ngOnChanges(changes: SimpleChanges) {
68 let valueChange = changes['value'];
69 if (valueChange && !valueChange.isFirstChange()) {
70 // this.path.slice is used to pass by value not by reference, because the function might modify the path
71 this.onValueChange(this.path.slice(), valueChange.currentValue, this.jsonStoreService);
72 // force to detect changes since onValueChange might change some other parts of top level json
73 this.changeDetectionRef.detectChanges();
74 }
75}
414optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) {
415 // This method is overwritten in ngOptions and has side-effects!
416 self.readValue();
417
418 var removal;
419 var previouslySelected = optionElement.prop('selected');
420
421 if (isDefined(oldVal)) {
422 self.removeOption(oldVal);
423 removal = true;
424 }
425 oldVal = newVal;
426 self.addOption(newVal, optionElement);
427
428 if (removal && previouslySelected) {
429 scheduleViewValueUpdate();
430 }
431});
126_onChange(value) {
127 this.ref.setAttribute(this.key, value);
128}
46get valueChanges(): Observable<any> { return this.control ? this.control.valueChanges : null; }
94setValue(value) {
95 // update the model
96 this.ngModel.$setViewValue(value[this.selectKeyProperty]);
97 this.ngModel.$render();
98
99 // close the drop down
100 this.close();
101}
168function Ng1Change(previousValue, currentValue) {
169 this.previousValue = previousValue;
170 this.currentValue = currentValue;
171}
130public onChange(to: unknown): void {
131 for (let i = 0; i < this.options.length; i++) {
132 if (this.options[i].value === to) {
133 this.selected = i;
134 return;
135 }
136 }
137
138 this.selected = -1;
139}
129valueChanged(val) {
130 if (val === null || val === undefined) {
131 this.sui('clear')
132 } else {
133 if (this.multiple === true && this.selectedItems.toString() != val.toString()) {
134 this.sui('set exactly', val);
135 } else
136 this.sui('set selected', val);
137 }
138}
195public writeValue(value: any) {
196 this.model = value;
197 this.refreshView();
198}

Related snippets