1

I am creating an ArrayProxy in the model hook of a route:

App.SomeRoute = Ember.Route.extend
  model: ->
    App.SomeArrayProxy.create()

Do I need to destroy this ArrayProxy in the deactivate hook of the route or will ember take care of destroying the model?

1 Answer 1

3

You are responsible for doing clean up on the model. Frequently, you model is a record from an identity map that you don't want to destroy/unload. But in your case, you may want to clean up the ArrayProxy. e.g.

deactivate: function(){
   this.controllerFor('some').set('model', null)
   this.currentModel = null;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.