Angular js App minification

微笑、不失礼 提交于 2020-01-16 18:48:13

问题


Very popular issue:

Unknown provider: nProvider <- n <- $http <- $templateFactory <- $view <- $state

I use MVC Bundling for this.

How to read this message?

Does it mean that $state requires $view that requires $templateFactory etc.?


回答1:


It was a problem in some external directives. So I go through all of them and fixed syntax of service injections:

from

app.service('myService', function($scope, $animate) {});

to

app.service('myService', ['$scope', '$animate', function($scope, $animate) {}]);

To understand where is the problem I have added all scripts to index.html. And then start to minificate scripts with MVC bundle part by part. After this I have found the incorrect for minification script.



来源:https://stackoverflow.com/questions/25341645/angular-js-app-minification

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