I have a component that I want to associate with another css class based on a boolean value. My component code has the following:
bindCssClass(div, "open", this, "task.isOpen"); bindCssClass(div, "closed", this, 'task.isClosed');
Where isOpen / isClosed are defined as follows:
@observable bool isOpen = true; get isClosed => !isOpen;
The question is, how can I get isClosed for observation, but based on isOpen changes? I would like to know this case, but also for cases that are more complex (for example, a string obtained from several components).
Also, is there a better way to use bindCss for such a simple case? Snap to '! Task.isOpen 'doesn't work, although it would be nice if that happened.
source share