btford/ngmin

Injector returned by angular.bootstrap is not treated

spalger opened this issue · 7 comments

Calls to angular.bootstrap return an injector, but ngmin doesn't extract dependencies from there. I have a call to invoke chained to my bootstrap call that isn't be wrapped by ngmin.

angular.bootstrap(document, [])
  .invoke(function ($rootScope) {
    // this function isn't wrapped in it's dependencies by ngmin
  })

+1 I'm experiencing the same issue.

Anyone know some workaround to this situation?
Thanks

@viniciusffj just use the array notation until it is supported.

angular.bootstrap(document, [])
  .invoke(['$rootScope', function ($rootScope) {
    // this function isn't wrapped in it's dependencies by ngmin
  }])

Thanks @spenceralger , it worked.

Please try https://github.com/olov/ng-annotate. ngmin is now deprecated: #93

If your issue isn't resolved there please open an issue at https://github.com/olov/ng-annotate/issues

If you really want ngmin to fix this issue, feel free to fork it and use that.