I have been utilizing factory methods in my angular controller. However, there has been a discussion that the factory not being destroyed may be causing memory leaks and ultimately leading to page slowdown.
Here is the syntax I am using to call the factory method:
bulkController.$inject = ['factory1'];
function bulkController(factory1) {
var style = factory1.getLevel1Cols(response);
};
Are there any concerns with the factory that I should be aware of? Should I be destroying the factory once we are done retrieving results? If so, how can I properly destroy the factory?
How can I implement destruction in AngularJS to handle variables, arrays, controllers, etc.?