It looks as though you might be using services incorrectly, as they are injected objects not usually available on $scope
. In order to use the filter service, you would do something like the following:
// inject the filter service into your controller
myModule.controller('MyCtrl', ['filterSrv', function(filterSrv){
// create your filter object and add it
var n = getName();
var filter = {
alias: 'My Filter',
editing: false,
query: 'name:"' + n + '"',
type: 'querystring'
};
filterSrv.set(filter, null, true);
}]);