how to run more than one angular directive modules on Pprod

大兔子大兔子 提交于 2019-12-03 09:32:07

The "prod" profile uses JavaScript minification (run by Grunt), which will reduce the size of your JavaScript file. As this modifies your JavaScript code, it can cause issues, depending on how you write your dependency injection code. Have you looked at the sample directives that are provided ? Or at the sample controllers ? You must write your dependency injection in the same style.

For example, to inject the $scope:

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

This will ensure the minification process won't break dependency injection of the "$scope" variable.

If you can't make it work, you can also exclude your files from the minification process: it depends on your load, but for most applications this is overkill. This is configured in your Gruntfile.js file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!