Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for inheritance in custom elements. #84

Closed
donald-slagle opened this issue Jun 2, 2015 · 2 comments
Closed

Add support for inheritance in custom elements. #84

donald-slagle opened this issue Jun 2, 2015 · 2 comments

Comments

@donald-slagle
Copy link

I have some custom elements for different types of modal windows, (delete confirmation, editor windows, etc..), that all share common code and have a common bindable property. All of the inherited code works except for the bindable property. The first modal that is loaded will be the only modal that is initialized for the lifetime of the app. Here is an example of my base class:

import $ from 'jquery';
import {bindable} from 'aurelia-framework';

export class BaseModal {
    @bindable config;

    static inject = [Element];
    constructor(element) {
        this.element = $(element);
    }

    attached() {
        this.config.element = this.element.find('.modal');
    }
}
@xandervdm
Copy link

I'm working on a UI widget library and created a BaseField base class and then a TextBox VM + Template that extends BaseField which renders and works fine.

I then created a Checkbox VM + Template that extends BaseField and that caused the TextBox to be incorrectly rendered as a Checkbox.

Sounds like it could be related to the above?

@EisenbergEffect
Copy link
Contributor

I don't think we're going to add this for now. I'm not sure it's a good idea. However, we have provided some options to use mixins to share behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants