0
我有3個JS文件在我的申請 (mainApp.js, template.js, app.js
)定義角模塊在不同的文件
的index.html
<html lang="en" ng-app="myapp">
mainApp.js
var app = angular.module('myapp',
['myapp.templateApp', 'myapp.demoApp']);
template.js
angular.module('myapp.templateApp', ['slick', 'localization'])
.controller('CountryLaunguageSelection', [
'$scope', '$rootScope','$http',
function($scope, $rootScope,$http) {
}
]);
個
app.js
var app = angular.module('myapp.demoApp', [
'ui.router',
'ui.grid',
'ngTouch',
'ui.grid.selection',
'ui.bootstrap',
'ngTable'
]);
app.config(function($stateProvider, $urlRouterProvider) {
});
我需要的3個模塊將在3個不同的files.Could有人告訴我,什麼是錯的,上面的代碼。
我提示以下錯誤:
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.28/$injector/modulerr?p0=app&p1=Error%3A%20…0%2FdemoApp%2Ftemplate%2Fthird-party%2Fangular%2Fangular.min.js%3A18%3A387)
您確實鏈接了索引文件中的所有文件? – Rouby
是的,我已經鏈接了這些文件。 –
正如Rouby所說的那樣。在注入模塊之前,請將所有js加載到dom中。像。 – Vineet