My web application is a single page app built with angular.js and it seems like I am experiencing some performance issues. The main controller and view for this app look like the following:
<div>
<div data-ng-switch-when="step1">
<div data-ng-include="'/partials/step1.html'"></div>
</div>
<div data-ng-switch-when="step2">
<div data-ng-include="'/partials/step2.html'"></div>
</div>
</div>
For each step, there is a separate controller - in my case, step1-ctl
and step2-ctl
.
My question is: When I select step2, does angular unbind all elements from step1, remove watches, and clean up resources? Also, when switching between steps, does angular create a new controller instance each time, along with adding callbacks, bindings, etc?