fabriciotav
fabriciotav

Reputation: 318

What is the proper way to call this._super() inside a ViewState?

I have the following StateManager:

App.wrapperView = Em.ContainerView.create();
App.wrapperView.append();

App.states = Em.StateManager.create({
    rootView: App.wrapperView,
    initialState: "loading",
    loading: Em.ViewState.create({
        view: App.LoadingView,
        enter: function() {
            this._super()  // _super is not defined.
            // other stuff goes here
        }
    })
});

Therefore, i cannot maintain the adding behavior.

How should i proceed?

Upvotes: 1

Views: 3493

Answers (2)

Emad
Emad

Reputation: 4200

I usually do this:

this._super(...arguments);

it's less typing and gets transpiled to

this._super.apply(this, arguments);

Upvotes: 1

Ryan
Ryan

Reputation: 3594

enter: function(manager, transition) {
  this._super(manager, transition);
}

More info here: http://docs.emberjs.com/#doc=Ember.StateManager&src=false

Upvotes: 3

Related Questions