Search code examples
javascriptangularjstypescriptuglifyjs

Angularjs, Typescript, Uglify and static $inject: Unknown provider


Receiving this error when trying to use a custom service that also uses an angular service:

Error: [$injector:unpr] Unknown provider: eProvider <- e <- LocService

See http://plnkr.co/edit/mX7TCPAO3VycUp4Nw2Oy?p=preview

The code is generated by the Typescript compiler. I have been using http://jscompress.com/ to simulate uglify.

Thanks in advance :-)


Solution

  • You have a typo: LocService.inject = ['$http'];

    Fix:

    LocService.$inject = ['$http'];