Skip to content

Commit

Permalink
Merge pull request #10213 from miguelcobain/overridable-attribute-bin…
Browse files Browse the repository at this point in the history
…dings

[FEATURE] override attribute bindings
  • Loading branch information
rwjblue committed Feb 6, 2015
2 parents 0e0046a + d27f762 commit b25a7b6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/ember-views/tests/views/view/attribute_bindings_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,21 @@ QUnit.test("blacklists href bindings based on protocol", function() {

equal(view.$().attr('href'), "javascript:alert('foo')", "value is not defined");
});

QUnit.test("attributeBindings should be overridable", function() {
var ParentView = EmberView.extend({
attributeBindings: ['href'],
href: "an href"
});

var ChildView = ParentView.extend({
attributeBindings: ['newHref:href'],
newHref: "a new href"
});

view = ChildView.create();

appendView();

equal(view.$().attr('href'), "a new href", "expect value from subclass attribute binding");
});

0 comments on commit b25a7b6

Please sign in to comment.