Set formControl value manually doesn't update the view
See original GitHub issueI’ve problems to set values manually in formControl. On ngOnInit, I call this code to test:
sliderControl: FormControl = new FormControl(360);
this.sliderControl.setValue(60)
On my view HTML, the value 60min appears and it’s ok. But the slider position, is on initial position, as you can see:

The position didn’t change. The expected behavior is:
.
My options:
options: Options = {
step: 30,
floor: 0,
ceil: 1439,
showSelectionBar: true,
getSelectionBarColor: (value: number): string => {
if (value <= 150) {
return 'green';
}
if (value <= 360) {
return 'yellow'; }
if (value <= 900) {
return 'orange';
}
if (value <= 1440) {
return 'red';
}
return '#2AE02A';
},
I’m using this version of ng5-slider: Version “ng5-slider”: “^1.1.14”,
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Set formControl value manually doesn't update the view #93
I've problems to set values manually in formControl. On ngOnInit, I call this code to test: sliderControl: FormControl = new FormControl(360);.
Read more >Angular FormControl does not update view when setValue
When setting the value manually it works ok but, if I update form value from typescript, the view does not reflect that change....
Read more >Updating Angular Forms with patchValue or setValue
Ignoring all the function arguments and types, all it does is call setValue , which - sets the value.
Read more >FormControlName
Syncs a FormControl in an existing FormGroup to a form control element by name. ... register multiple form controls within a form group...
Read more >Angular Reactive Forms: Tips and Tricks
By default, whenever a value of a FormControl changes, Angular runs the control validation process. For example, if you have an input that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

In recent changes, I re-wrote most of value update and normalisation code using rxjs, fixing a lot of similar bugs.
This should be fixed once I make the next release in the next day or two.
Just an FYI, we found that this is in fact the issue. The library expects numeric values, but works for most use-cases with strings. We switched our values to numeric and this corrected this issue.