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

[Bug] Additional attributeBindings on LinkView do not work as of 1.13.0 #11593

Closed
mike-north opened this issue Jun 29, 2015 · 2 comments
Closed
Labels

Comments

@mike-north
Copy link
Contributor

If developers wish to add attributes to their anchor tags, beyond the standard set supported by ember out of the box,

{{link-to "My link" "index" data-activates="activate-me"}}

the advised approach is something like this

  Ember.LinkView.reopen({
    attributeBindings: ['data-activates']
  });

This approach works in ember 1.12.x but does not in 1.13.x. This is due to the replacement of LinkView with LinkComponent.

My proposed fix is something like

Ember.LinkView.reopenClass({
  reopen: function () {
    Ember.LinkComponent.reopen.apply(Ember.LinkComponent, arguments);
  }
});

which seems to work.

I'm happy to work on a PR once I get the "go ahead" on this approach

@ef4
Copy link
Contributor

ef4 commented Jun 29, 2015

This seems like an acceptable way to provide backward compatibility. It looks a little WAT, but since accessing LinkView is already deprecated, I'm ok with it.

👍

@adentranter
Copy link

Is there a reason this can't be used for adding the 'onclick'?

Example

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

No branches or pull requests

4 participants