coryrylan / ngx-lite

:package: A collection of lightweight Angular libraries in a single mono repo
https://ngxlite.com
MIT License
138 stars 21 forks source link

changeDetection doesn't work when set new value directly with control.setValue() with @ngx-lite/input-star-rating component #27

Open lamstutz opened 5 years ago

lamstutz commented 5 years ago

Describe the bug changeDetection doesn't work when set new value directly with control.setValue() with @ngx-lite/input-star-rating component

To Reproduce Steps to reproduce the behavior:

  1. Working https://stackblitz.com/edit/angular-7ukkya reproducible demo
  2. Click on 'set to 2' button, the component doesn't updated :(

Expected behavior when myControl.setValue(3) is called, the component must show 3 stars

aavanzyl commented 4 years ago

I get the same issue. When I set the initial value when constructing the form, that works, but when patching or setting the value directly fails. One thing that happens on the UI thou is that once I click on the input, the values update.

Not Working:

this.formGroup.patchValue(this.myJson);

OR

this.formGroup.get('tags').setValue(this.myJson.tags);