When working with canJS Observable, I encountered an issue where I cannot use dots in object keys because canJS interprets them as nesting. For example, if I try to create a new observable like this:
var obs = new can.Observe( { "div.test-class": { "color": "#000000;" } } );
canJS fails with the message:
can.Observe: Object does not exist
Similarly, creating an observable without dots results in another error:
var obs = new can.Observe( { ".test-class": { "color": "#000000;" } } );
This time, canJS throws the following error:
TypeError: current._set is not a function
One workaround is to create the observable like this:
var obs = new can.Observe( { "div": {}, "div.test-class": { "color": "#000000;" } } );
Although this solution works, it introduces unnecessary nesting that I do not need. Can anyone suggest a better approach to achieve what I need?