I was wondering if it’s possible to figure out the owning component in a custom attribute?
I know you can inject the Dom element in an attribute, I was wondering if there’s a way to figure out what aurelia component that element is a child of?
<template> <div my-custom-attribute="test"></div> </template>
... I want to get the 'my-component-or-view' name here ...
The specific use-case is that I want to write a custom translation attribute that automatically defines the i18N namespace based on the owning component. We want to split our translation namespaces on a per-component basis, but constantly repeating the namespace in each component isn’t very DRY. Any other suggestion in tackling this is much appreciated.