-->

How to make angular decorators minification friend

2020-07-11 06:04发布

问题:

How to can I make this code that I have minification friendly?

MyModule.config(['$provide',function($provide) {
    $provide.decorator("$exceptionHandler", function($delegate,$injector) {

I can't seem to do this:

  $provide.decorator("$exceptionHandler" , "$delegate","$injector", function($delegate,$injector) {

回答1:

You are missing the [. The pattern is the same that you successfully applied for config:

$provide.decorator("$exceptionHandler" , [ "$delegate","$injector", 
    function($delegate,$injector) {