Skip to content

Instantly share code, notes, and snippets.

@katowulf
Created September 18, 2014 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save katowulf/1d88bd6106a535d0f8b9 to your computer and use it in GitHub Desktop.
Save katowulf/1d88bd6106a535d0f8b9 to your computer and use it in GitHub Desktop.
Explain the unknown provider <-- a error that occurs in dist files created with ngMin
// ngmin can handle this fine; if not using ngmin, then
// we'd do ['$provide', function($provide) { ... }]
app.config(function($provide) {
// however, ngmin does not know how to preserve the injected dependencies here!
$provide.decorator('SomeFactory', function($delegate, $timeout) {
});
});
app.config(function($provide) {
// we can use the same pattern here that works for outer function dependencies
// to give ngmin a hand up off it's faceplant
$provide.decorator('SomeFactory', ['$delegate', '$timeout', function($delegate, $timeout) {
}]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment