In Communication between "sibling" ViewModels, I said:
Conceptually, I’m attempting to 1) build a series of similar HTML elements in a loop; and 2) listen and respond to changes and/or events occurring on each one separately.
I’ve since coded a CanJS color chooser, my first framework-based web project. It attempts to accomplish the above, but I have some questions about my design. In particular:
Do I rely too heavily on global variables to share information between ViewModels?
Can I create a
<final-el>VM to manage color cell properties individually rather than relying on indexes in their element ID’s? (for details see
todo: <final-el>in the project’s index.html file).
I want to play a sound effect when the user hovers over a grid cell, but the sound lags so far behind the visual display as to degrade rather than improve UX (see
todo: address lagin index.html). Is there a better way?
The full source code is posted on GitHub. Thanks In Advance for your constructive criticism!