I’m attempting to use CanJS to:
Create multiple instances of the same custom element (e.g.,
Act on a single instance of this custom element when that element is the origin of an event (for example a hover event).
For example, if I hover over a single
<canEl> among many, I would like CanJS to modify content of that single element only.
I thought this would be natural and simple for CanJS, but despite much research and numerous attempts haven’t been able to cause CanJS to act on on the element of origin only. Instead, CanJS always seems to modify every instance of the custom element.
I realize I can work around this by simply not reusing the same custom element, or by adding a unique identifier to each instance of the same custom element. But I’m hoping for a more manageable and scalable solution.
I have also found some workarounds provided by CanJS such as custom-coding viewModel at a low level, or using enhancements to the standard framework (superMap?). But I would rather not push the limits of CanJS if possible.
Below is a JS Bin demonstrating my problem. Is there a simple, easy solution, and if so where might I have found it in the documentation or training? TIA.