I have done a web application based in ASP MVC and angularJS, and everything works fine. Now, I want deploy it. In my bundleConfig I have put BundleTable.EnableOptimizations = true; to minified my scripts.
When I launch the app get a error:
Module 'dataService' is not available! You either misspelled...
In docs I have seen an interesting thing (it fits to error):
Careful: If you plan to minify your code, your service names will get renamed and break your app.
As docs suggests I use Inline Array Annotation. My code is:
app = angular.module("MyApp", ['ui.router', 'ui.bootstrap', 'kendo.directives', 'dataService', 'LoginFactory', 'globalService']);
in module dataService is:
app.service('dataService', ['$http', function($http) {
// service logic
}]);
I thought that would fix the error, but not.
PS: I have seen 3 differents methods of injection dependencies and I have used all. In example I use that because in docs is marked like preferred
dataService, your second one defines a servicedataService. Do you have a module nameddataService?angular.module("MyApp"creates the moduleMyAppwhich depends on other modules.ui.routeris a module,ui.bootstrapis a module. Ifappin the second example is the same module asappin the first one then you are done. RemovedataServicefrom the first one. Maybe you should look at someone's scores before you decide to write "I don't think you understand".