Comments (3)
@lorond I believe you hit the issue of derived class retrieving base class metadata. We have provided doc for this, but probably it's easy to miss. Did you have a look at https://aurelia.io/docs/templating/html-behaviors#inheritance-with-html-behaviors? Note:
Second, notice that we explicitly declared @CustomElement(). Any time you inherit a custom element, you must add the customElement decorator.
It doens't need to be a @customElement
decorator though, any metadata-stamping decorator would do: @bindable
, @useShadowDOM
, @templateController
etc...
Here's some example you can have a look at: https://discourse.aurelia.io/t/example-of-binding-inheritance/428
@jods4 @EisenbergEffect @fkleuver We can fix this behavior of inheritance, that is surprising users here and there with probably a simple change: get own metadata instead of first available metadata in the hierarchy. Though I'm not sure the potential breaking changes, but it seems to me anything that is not working would suddenly work. Not sure if it's a good idea. Thoughts?
from templating.
Thanks @bigopon. Yep, I missed that. I'll do a PR a bit later to highlight this in the docs, ok?
from templating.
@lorond that'd be awesome
from templating.
Related Issues (20)
- Aurelia enhance() will crash if a <compose> element exists within a compiled component HOT 4
- @children Only Working in Chrome HOT 27
- Can't get property from view model in repeater HOT 5
- ElementEvents.subscribe set useCapture to true by default, which is not standard HOT 6
- custom attribute bindable properties with interpolated values won't fire updates HOT 1
- Interface imports in output files HOT 10
- Constructor not called first HOT 4
- child-observation is broken when Zone.js is present on page and wraps MutationObserver HOT 5
- Custom elements as table rows break layout when importing resources as first business HOT 6
- A named slot cannot be used as content for the default slot of a child component HOT 1
- Failing karma tests report incorrect line numbers in console stacktrace
- Custom element creation is confusing HOT 5
- @child() decorator does not work properly in combination with if.bind HOT 2
- Initial range input displayed value rounded when value specified before step HOT 1
- CustomAttribute is not being evaluated when on or inside an if.bind-Element HOT 5
- Trash files in repo HOT 1
- Upgrading electron caused <compose> to hide other parts of UI HOT 4
- In aurelia template, it shows "Cannot read properties of null (reading 'insertBefore')" error. HOT 3
- Custom attribute primary property same name as attribute HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templating.