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

Error when there is a 'currentState' property on a component #11374

Closed
gethinwebster opened this issue Jun 8, 2015 · 1 comment
Closed

Error when there is a 'currentState' property on a component #11374

gethinwebster opened this issue Jun 8, 2015 · 1 comment

Comments

@gethinwebster
Copy link

In Ember 1.13.0-beta.2, having a component with both a currentState property and an init method with a call to this.set on any property causes the following error:

Uncaught TypeError: this.currentState.legacyPropertyDidChange is not a function

See: http://jsfiddle.net/as72hpe0/, extract:

App.MyComponentComponent = Ember.Component.extend({
    foo: 'bar',
    currentState: 'myOwnProperty',
    init: function(){
        this.set('foo', 'something');
        this._super();
    }
});

In the documentation, currentState is not specified as being a private property of Ember.Component, but it appears that it's being used as such internally.

Code ref:

@rwjblue
Copy link
Member

rwjblue commented Aug 21, 2015

Sadly, this was missed during the work for Ember 2.0.0. I updated the internals in #12163 to move the reserved word to ._currentState, and flagged the .currentState deprecation to be removed in 2.3.0 (after the next LTS release).

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