How to run more than one angular directory modules in Pprod

I am working on version 1.7.0 for jhipster, and I have several types of directory modules in our jhipster application. First for the index page and second for the commmon directive.

When we run the Prod profile, I got an exception: -

[31mPhantomJS 1.9.7 (Windows 7) ERROR [error 39 m: [$ injector: nomode] The "shared services" module is unavailable! You either mistakenly wrote the name of the module or forgot to load it. If registering a module ensures that you specify the dependencies as the second argument. http://errors.angularjs.org/1.2.11-build.2192+sha.e2173f9/ $ injector / nomod? p0 = shared services in D: / github_repo / compile-our-code / src / main / web application / bower_components / angular / angular.js: 1531

the same code works on the development profile.

Please help me resolve this error as soon as possible.

+4
source share
1 answer

The prod profile uses JavaScript minimization (performed by Grunt), which will reduce the size of your JavaScript file. Since this modifies your JavaScript code, it can cause problems, depending on how you write the dependency injection code. Have you reviewed the sample guidelines given? Or in control samples? You should write your dependency injection in the same style.

For example, to enter the scope of $ scope:

jhipsterApp.controller('MainController', ['$scope',
    function ($scope) {
}]);

This will ensure that the minimization process does not violate the dependency injection of the $ scope variable.

, -: , . Gruntfile.js.

+2

Source: https://habr.com/ru/post/1526521/


All Articles