angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

Suggestion - (Error) Output - Why exaclty the controller couldn't be instantiated #385

Open gabrielschnegelberger opened 8 years ago

gabrielschnegelberger commented 8 years ago

I think that at least the production version should print out the error why exactly the controller X couldn't be created. There is just a error warning - that there was a problem - but the real error (Parameter e) is not printed.

But this parameter is the real useful!

So there should be in my opinion following line added: console.warn && console.warn(e);

Complete:

try {
     ctrl = $controller(controllerName, locals);
} catch(e) {
     console.warn && console.warn('Could not instantiate controller', controllerName);
     console.warn && console.warn(e);
     ctrl = $controller(angular.noop, locals);
}

componentrouterwarningcontroller