I would have done this personally:

```js
module.provider('gaStyleFunctionFactory', function() {
  this.$get = function() {
    ...
    return function(type) {
       return function(feature, resolution) {
         return styles[type][feature.getGeometry().getType()];
       };
    };
  };
});
```