Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does ember destroy controller instances

Tags:

ember.js

I was wondering when Ember does garbage collection for all the controller objects. I had route structure like :

AS.Router.map(function () {

            this.resource('employee', function () {
                this.route('basics');
                this.route('services');
                this.route('advanced');
            });

});

I have noticed that when I move from basics route to services route, the EmployeeBasicsController is not getting destroyed. I am not sure if it is by design, or I would have to do it manually(using the destroy action).

like image 482
Deewendra Shrestha Avatar asked Feb 22 '26 05:02

Deewendra Shrestha


1 Answers

It's by design, Ember uses singleton instances by default.

like image 197
Kingpin2k Avatar answered Feb 24 '26 06:02

Kingpin2k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!