MVC Bundling Problem
I am running AngularJS/angular-datetime (latest build) in a legacy ASP.net MVC 5 application. Within the application, all page script management is handled by the MVC ScriptBundle manager.
With ScriptOptimisation turned off, angular-datetime works perfectly, but with the ScriptOptimisation turned on I get the following error when the datetime attribute is referenced in the view:
Error: [$injector:unpr] http://errors.angularjs.org/1.3.15/$injector/unpr?p0=nProvider%20%3C-%20n%20%3C-%20datetimeDirective
I am new to AngularJS, but I am guessing this is a problem related to parameter name changing during the script bundling/minification process?
Finally, thank you for taking the time to build this extension - it addresses my needs perfectly.
I think I may have resolved the problem by wrapping the main entry point methods as follows:
angular.module("datetime").factory("datetime", ['$locale', function ($locale) { ... }]);
and
angular.module("datetime").directive("datetime", ['datetime', '$log', function (datetime, $log) { ... }]);
But, as I say, I am new to AngularJS so this might be 'hacky'.
It's not hacky. Actually it's recommended to release all code using explicit annotation.
I will add ng-annotate to the build process.