there is something about how angular decares custom components and scopes
From the first glance they don't have such thing.
In SCOPE declartion they use the @ and @attr to bind property to string attribute which aligns with can.js and they use = and =attr for two-way bound attributes from parent scope,
They use ? (=?attr ) to indicate that attr is optional.
Seems nothing more about passing and binding data attributes.
In REQUIRE declaration they use ^ symbol to refer to parent. Maybe this symbol can be used for this purpose
- scope: {
- settings: '^settings' //will try to look up and bind "settings" from upper level scopes. In will be overridden if "settings" attribute is present on the element.
- }
Also this can be achieved by using some additional sintax outside of scope declaration, for example:
- can.Component({
- ...
- defaultAttrs: {
- settings: 'settings' // this means that while init attr settings="settings" should be added on the component's elements and two way binding performed.
- }
- ..
- })
Well just ideas.