ngx-slider icon indicating copy to clipboard operation
ngx-slider copied to clipboard

core.js:6157 ERROR TypeError: control.registerOnChange is not a function

Open harleenarora opened this issue 3 years ago • 1 comments

Hi,

If using reactive form, field is array and bind with ngx-slider, show error::

core.js:6157 ERROR TypeError: control.registerOnChange is not a function at setUpModelChangePipeline (forms.js:2559) at setUpControl (forms.js:2381) at FormGroupDirective.addControl (forms.js:5710) at FormControlName._setUpControl (forms.js:6285) at FormControlName.ngOnChanges (forms.js:6230) at FormControlName.rememberChangeHistoryAndInvokeOnChangesHook (core.js:1506) at callHook (core.js:2525) at callHooks (core.js:2492) at executeInitAndCheckHooks (core.js:2443) at refreshView (core.js:9428)

Code:: <ngx-slider formControlName="range" [options]="options"></ngx-slider>

this.testForm = this.fb.group({
	range:this.fb.array([0,45])
});

harleenarora avatar Mar 12 '21 04:03 harleenarora

I fixed this by changing my field from a FormArray to a FormControl with an array value.

DustinJSilk avatar Aug 09 '22 13:08 DustinJSilk