-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override default selected color after initialization #275
Comments
Make sure you’re triggering change detection and replacing the color object you are passing and not modifying it |
Hi, I'm having the same problem. Where should I trigger the change detection? |
check out how the demo works, its doing exactly this. https://github.com/scttcper/ngx-color/blob/master/src/app/app.component.ts |
I did not understood the first message, sorry. I'll open a new issue with the problem I have |
I'd like to add the same issue. I cannot change the color of the component after initialization. I have attempted to change the color, currentColor, and hex variables. Nothing seems to work. This is a problem if you are trying to programmatically make changes using this.component.color for example. |
A workaround for anyone looking is to manually force ngOnChanges after a change in your component:
|
I followed this: https://github.com/scttcper/ngx-color/blob/master/src/app/app.component.ts Then I put state on my load method: async loadData(id: string) { That's worked for me!!! |
This is not a bug, this is 2 requests:
Once you've created color component (e.g.: color-sketch), I am unable to override programmatically it's value, because seems like "[color]" input parameter seems like one way binded, it doesn't care the color object has changed on parent even if I try to send like this: "[(color)]".
Is it possible to modify preset colors somehow? If not please can you put that in?
Thanks
The text was updated successfully, but these errors were encountered: