我正在尝试启动一个应用,但有两件事会导致错误
我的$locationProvider
函数中有$compileProvider
和config()
?但似乎无法弄清楚为什么?
我正在运行 AngularJS v1.6.2 。
我得到的错误是:
Uncaught Error: [$injector:modulerr] Failed to instantiate module zerochili due to:
Error: [$injector:unpr] Unknown provider: t
如果我删除config
,应用程序运行时没有任何问题......
代码:
import svg4everybody from 'svg4everybody';
import angular from 'angular';
import GlobalController from './Global/GlobalController';
let zeroChili = angular.module('zerochili', []);
zeroChili.config(function($locationProvider, $compileProvider) {
$locationProvider.html5Mode(true);
// this increases performance significant
$compileProvider.debugInfoEnabled(true);
// to run debug in production, run this in console:
// angular.reloadWithDebugInfo();
// see: https://docs.angularjs.org/guide/production
});
zeroChili.controller('GlobalController', GlobalController);
function runApp() {
angular.bootstrap(document, ['zerochili']);
}
runApp();