angular.js:88未捕获的错误:[$ injector:modulerr]

时间:2018-08-25 05:40:01

标签: javascript angularjs

我有这样的错误:

  

未捕获的错误:[$ injector:modulerr] http://errors.angularjs.org/1.6.9/ $ injector / modulerr?p0 = myApp&p1 = Error%3A%2 ... ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.6.9%2Fangular.min。 js%3A22%3A332)

这是我的 index.html

<html ng-app='myApp'>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <meta content="" name="description">
  <meta content="" name="author">
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-route.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.6/angular-animate.js"></script>
  <!-- CORE CSS FRAMEWORK - START -->
  <link href="assets/plugins/pace/pace-theme-flash.css" rel="stylesheet" type="text/css" media="screen">
  <link href=" assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  <link href="assets/plugins/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
  <link href="assets/fonts/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
  <link href="assets/css/animate.min.css" rel="stylesheet" type="text/css">
  <link href="assets/plugins/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" type="text/css">
  <link href="assets/css/style.css" rel="stylesheet" type="text/css">


  <script src="assets/app.js"></script>
  <script src="assets/approute.js"></script>
  <script src="assets/js/controller/logincontroller.js"></script>
  <script src="assets/js/controller/dashboardcontroller.js"></script>

</head>

<body class=" ">
  <div ui-view></div>

  <script src="assets/js/jquery-1.11.2.min.js"></script>
  <script src="assets/js/jquery.easing.min.js"></script>
  <script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="assets/plugins/pace/pace.min.js"></script>
  <script src="assets/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
  <script src="assets/plugins/viewport/viewportchecker.js"></script>
  <script>
    window.jQuery || document.write('<script src="assets/js/jquery-1.11.2.min.js"><\/script>');
  </script>

  <script src="assets/js/scripts.js"></script>
</body>

</html>

这是 app.js

var app = angular.module("myApp", ['ui.router','ngAnimate']);

这是 approute.js

app.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
  $urlRouterProvider.otherwise('/login');
  //$urlRouterProvider.otherwise('/login');
  $stateProvider
    .state('login', {
      url: "/login",
      templateUrl: "views/ui-login.html",
      controller: 'LoginController',

    })
    .state('index-dashboard', {
      url: "/index-dashboard",
      templateUrl: "views/index-dashboard.html",
      controller: 'DashboardController',

    })
});

1 个答案:

答案 0 :(得分:1)

已发布解决

我不敢相信,但这对我有用 ng-app =“ app” ng-app“ app”

Angular JS Error: [$injector:modulerr]