I have a single page webapp based on angular.js And seems like I have performance problems. so I have the main controller and view for it which looks like this
<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 I have it's own controller, in our case is step1-ctl
and step2-ctl
.
So my question is: when I select step2, does angular unbind all elements from step1, remove watches and clean resource? And second question - when I switching between steps, does angular create new controller instance each time, add callbacks, binding, etc?