Skip to content

Minification breaks userapp-angular #11

@johanbuys

Description

@johanbuys

Hi,

After a lengthy debugging session on my own app I was able to isolate a problem I was having to the UsesApp-Angular module.

To try and proof that it was not my code I used the example app code from this repo and the same issue occurred.

The Issue: When you minnify and combine js sources angular moans about "Unknown Provider"

My Setup:

Using Gulp I minify and combine the example using gulp-useref and gulp-uglify then start the app using gulp-connect. The App fails with the standard angular provider error:

Uncaught Error: [$injector:unpr] Unknown provider: eProvider <- e
http://errors.angularjs.org/1.2.3/$injector/unpr?p0=eProvider%20%3C-%20e

From my experience this is mostly caused by the injector, which is unable to find the module to inject, when a minifier changes variable names and thus changes the name the injector will search for, usually this is easily solved by using the array syntax when defining controllers, services and the like ie

  angular.controller('contr',['$scope',function($scope){}]);

Unfortunately up to now I am still unable to find the erroneous module.
Been spending a few days on this now. Hope some one can help with this. I will try and continue to find out what the issue might be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions