Created
September 18, 2014 15:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) { | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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