-
Notifications
You must be signed in to change notification settings - Fork 9
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
Usage of targetObject
is deprecated
#13
Comments
@asross Did you ever get a chance to think about which direction to take this? I'm willing to work on a PR |
Hey, thanks for the issue and your willingness to work on a PR. This is a tricky one, isn't it? The best thing would be if we could somehow use If it isn't, then I think we should just bite the bullet and introduce another property like attributeBindings: ['linkTarget:target'],
linkTarget: Ember.computed('params.linkTarget', 'params.target', function() {
return this.get('params.linkTarget') || this.get('params.target')
}),
performAction: function() {
var target = this.get('target') || this.get('targetObject') || this.get('_targetObject');
// ...
} We can then remove support for the bare |
Actually, if we wanted to be really sneaky, we could check if linkTarget: Ember.computed('params.linkTarget', 'params.target', 'target', function() {
if (typeof this.get('target') === 'string') {
return this.get('target');
} else {
return this.get('params.linkTarget') || this.get('params.target');
}
}),
performAction: function() {
var target = this.get('target');
if (typeof target === 'string') {
target = this.get('targetObject') || this.get('_targetObject');
}
// ...
} Then we avoid introducing a backwards incompatibility :) |
Was trying to fix this deprecation:
DEPRECATION: <client-web@component:dynamic-link::ember3232> Usage of
targetObject
is deprecated. Please usetarget
instead. [deprecation id: ember-runtime.using-targetObject]However, it seems that target is already being used to bind the html target attribute. So I'm not sure how to approach this one.
Personally, I think that using 'target' for the html property / binding makes more sense than using some alias. But given that Ember is now using target to mean something else.. I'm not sure what else can be done to make them coexist nicely.
Am I overlooking something? Did they overlook this case when they changed the API?
Any thoughts?
Thanks
The text was updated successfully, but these errors were encountered: