I have many filters on my page. I am using $location.search to save search parameters in hash. But angular is creating new controller instance on every search param change which I want to prevent.
I don't want to create new instance of controller on each $location.search() call.
When creating the route definition set reloadOnSearch
to false
angular.module('ngView', ['$routeProvider', function(routeProvider) {
routeProvider.when('/my-path', {
templateUrl: 'my-template.html',
controller: 'MyController',
reloadOnSearch : false
});
}]);