Yes this works.
I use this to assign my model classes from parent to child elements.
Do you have any issues with it?
An issue with this is, that the DOM doesn't see the attribute being added.
In an unit test I tried to use a MutationObserver to be notified when an attribut was set,
but this works only when a primitive value is assigned.