Reputation: 81
This is my problem ...
I prepare the next small exmaple, with the gruntFile.js and i can get minify this
this is the error that i have:
Uncaught Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.11/$injector/nomod?p0=myApp
this is the link to see my example:
https://github.com/juliovg/minification_Test.git
can somebody help me?
Thanks
Upvotes: 0
Views: 80
Reputation: 136134
1st thing remove one ng-app="myApp"
directive to initialize, because it has declared you twice.
You must follow array annotation of dependency injection to ensure the correct minification without error, you missed it inside directive.
Directive
angular.module('myApp')
.directive('beerFormDirective',[ function() {
return {
restrict: 'AE',
templateUrl: 'js/directives/beerForm/beerForm_view.html',
scope: {},
controller: 'beerForm_controller' //added controller from view
};
}]);
and remove ng-controller
from your html template.
& for better performance do load javascript file from local rather than from cdn
Upvotes: 1