I'm not sure of the best way to integrate this with Angular.
It would be nice for controllers to be able to dim/undim Dimmer objects. However, Controllers should not be performing any kind of DOM manipulation. I was thinking about putting it into a Service, but I'm not sure.
My imagined use case looks something like:
<dimmable>
<...dimmable contents...>
</dimmable>
Which would add an element to the $dimmer service, called from a controller like so:
// These are terrible method names, something better like show/hide would be more appropriate
$dimmer.dim();
$dimmer.light();
I suppose the controller could specify an ID or some other selector when calling these methods. But it still sort of feels wrong.
So, I'm not totally sure how to put control of dimming/lighting into the hands of a controller, in a way that doesn't suck.
Thoughts? Feelings?
I'm not sure of the best way to integrate this with Angular.
It would be nice for controllers to be able to dim/undim Dimmer objects. However, Controllers should not be performing any kind of DOM manipulation. I was thinking about putting it into a Service, but I'm not sure.
My imagined use case looks something like:
Which would add an element to the
$dimmerservice, called from a controller like so:I suppose the controller could specify an ID or some other selector when calling these methods. But it still sort of feels wrong.
So, I'm not totally sure how to put control of dimming/lighting into the hands of a controller, in a way that doesn't suck.
Thoughts? Feelings?