0
votes

I have an error like this:

Uncaught Error: [$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)

this is my 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>

and this is app.js

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

this is 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
@KrishnaSingh I have already define angular.animate.js dependency in the index file and thx for the responseRushi dave
@saeed tx for the editingRushi dave
how about your controller ? simply error mean there is something wrong with dependencies . it might be in your controllers.Arash
I have used approute in controller and controller file connected in HTML file so the controller does not define in any file and the same Project I have already run but I fetched error in the project.Rushi dave

1 Answers

1
votes

issued solve

I can't believe but it's work for me using ng-app="app" to ng-app"app"

Angular JS Error: [$injector:modulerr]