10 examples of 'angular patch value' in JavaScript

Every line of 'angular patch value' 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
320patchValue(value, options = {}) {
321 this.setValue(value, options);
322}
260function ngAriaWatchModelValue() {
261 return ngModel.$modelValue;
262}
27export function cleanAngularProps(value) {
28 // remove all props that start with '$$' - that's what `angular.toJson` does
29 const omitAngularProps = (obj) => {
30 each(obj, (v, k) => {
31 if (('' + k).startsWith('$$')) {
32 delete obj[k];
33 } else {
34 obj[k] = isObject(v) ? omitAngularProps(v) : v;
35 }
36 });
37 return obj;
38 };
39
40 const result = cloneDeep(value);
41 return isObject(result) ? omitAngularProps(result) : result;
42}
120writeValue(value: EntityId | null): void {
121 if (value != null) {
122 this.modelValue = value;
123 this.entitySelectFormGroup.get('entityType').patchValue(value.entityType, {emitEvent: true});
124 this.entitySelectFormGroup.get('entityId').patchValue(value, {emitEvent: true});
125 } else {
126 this.modelValue = {
127 entityType: this.defaultEntityType,
128 id: null
129 };
130 this.entitySelectFormGroup.get('entityType').patchValue(this.defaultEntityType, {emitEvent: true});
131 this.entitySelectFormGroup.get('entityId').patchValue(null, {emitEvent: true});
132 }
133}
195public writeValue(value: any) {
196 this.model = value;
197 this.refreshView();
198}
323_setElementValue(value) {
324 this._renderer.setProperty(this._element.nativeElement, 'value', value);
325}
100get modelValue(): any {
101 return this.ngValue;
102}
443private setStateValue(v: boolean): void {
444 if (v !== this._innerState) {
445
446 this._onChangeCallback(v);
447
448 this.changeState.emit({
449 previousValue: this._innerState,
450 currentValue: v
451 });
452 this._innerState = v;
453 }
454}
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}
148setInputValue(property, value) {
149 if (strictEquals(value, this.getInputValue(property))) {
150 return;
151 }
152 if (!this.componentRef) {
153 this.initialInputValues.set(property, value);
154 return;
155 }
156 this.recordInputChange(property, value);
157 (/** @type {?} */ (this.componentRef.instance))[property] = value;
158 this.scheduleDetectChanges();
159}

Related snippets