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

[REGRESSION] In Ember 1.13.0+ initial literal values of component attributes cannot be updated #11559

Closed
OrKoN opened this issue Jun 26, 2015 · 8 comments

Comments

@OrKoN
Copy link

OrKoN commented Jun 26, 2015

See jsbin http://emberjs.jsbin.com/likiqofaxa/1/edit?html,js,console,output

If you pass a literal as an attribute value, the component cannot update it:

    {{my-component test="initial-value"}}
    {{my-component}}

where MyComponent is

var MyComponent = Ember.Component.extend({
  test: null,
  init: function() {
    this._super();
    this.set('test', 'updated');
  }
});

The first does not work(test is not updated in the component template) and the second works as expected.

I am migrating from 1.12. jsbin http://emberjs.jsbin.com/tuhisokijo/1/edit?html,js,console,output

@stefanpenner
Copy link
Member

i would assume:

this.set('test', this.get('test') || 'updated');

would be the way to deal with defaults in init

@OrKoN
Copy link
Author

OrKoN commented Jun 27, 2015

@stefanpenner the problem is that one cannot override the defaults

@rwjblue
Copy link
Member

rwjblue commented Jun 28, 2015

Submitted #11572 to address this.

@OrKoN
Copy link
Author

OrKoN commented Jun 29, 2015

@rwjblue Thanks a lot! Will the fix appear in the 1.13.3 release? When may I expect it?

@rwjblue
Copy link
Member

rwjblue commented Jun 29, 2015

Yes, it will be in 1.13.3 (should be out in a day or two).

@OrKoN
Copy link
Author

OrKoN commented Nov 4, 2015

@rwjblue @stefanpenner This is happening again in Ember 2.1.0 (regression compared to 2.0.2) http://emberjs.jsbin.com/yinuqe/edit?html,js,console,output

@rwjblue
Copy link
Member

rwjblue commented Nov 4, 2015

@OrKoN - Can you open a new issue?

@OrKoN
Copy link
Author

OrKoN commented Nov 4, 2015

@rwjblue sure, opened a new one

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

4 participants