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

attribute binding override #10176

Closed
miguelcobain opened this issue Jan 9, 2015 · 4 comments
Closed

attribute binding override #10176

miguelcobain opened this issue Jan 9, 2015 · 4 comments

Comments

@miguelcobain
Copy link
Contributor

Couldn't find any information on this.

I'm trying to extend some behaviour of Ember.TextField. I'm trying to add some logic for type="datetime-local" inputs, to be able to bind date-typed variables directly.

As we know, input values are strings, not dates. So in my new class that extends Ember.TextField I need a new property to be bound to the input that is basically a date converted to a string that the input expects.
Ideally I would like to reopen Ember.TextField and then only apply this logic if the input type is datetime-local and the bound value is a Date.

My 2 questions are:

  1. Is there any way to change an attribute binding defined in a superclass?
    If it were possible I could just write attributeBindings:['value:textValue'] in my View/Component subclass. This would override the previous value binding definition from Ember.TextField.
  2. Is this date binding support feature desired in the core?
@trek
Copy link
Member

trek commented Jan 12, 2015

This is a great question for StackOverflow. We try to use Issues only for reporting bugs. You can check the contributing guidelines https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md for information about ways to post.

Please link the StackOverflow question back here when you've posted.

@trek trek closed this as completed Jan 12, 2015
@trek
Copy link
Member

trek commented Jan 13, 2015

@miguelcobain where you able to post this to SO and get help?

@miguelcobain
Copy link
Contributor Author

@trek, yes: http://stackoverflow.com/questions/27906553/how-to-override-attribute-bindings-in-emberjs/27921578#27921578

There is a working solution, but I'd rather see Ember supporting something like "overridable concatenated properties", or "overridable attribute/class bindings".

@miguelcobain
Copy link
Contributor Author

Is this feature desired in core?
I would be happy to try and make a PR. :)
Probably behind a feature flag?

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

No branches or pull requests

2 participants