ColorPickerService should be providedIn: 'root'
Opened this issue · 0 comments
jnizet commented
The only state of the service is the active color picker:
private active: ColorPickerComponent | null = null;
public setActive(active: ColorPickerComponent | null): void {
if (this.active && this.active !== active && this.active.cpDialogDisplay !== 'inline') {
this.active.closeDialog();
}
this.active = active;
}
The intention of this code, as I understand it, is to have only one active color picker at once in the application. It doesn't make much sense to me to have one active color picker per lazy-loaded module. And if that was really desired, it would still be possible to explicitly add the service to the providers of each module.