Angular UI Router transition error

600 views Asked by At

"angular 1.6.1", "angular-ui-router 0.3.1", All ui views changed/worked correctly but i'm getting the following error in my console window, i don't know why.

enter image description here

My HTML code is

<!DOCTYPE html>
<html lang="en" data-ng-app="manoj">
<head>
    <meta charset="UTF-8">
    <title>My App</title>
    <link rel="stylesheet" href="assets/style/angular-material.css">
    <link rel="stylesheet" href="assets/style/materialdesignicons.min.css">
    <link rel="stylesheet" href="assets/style/style.css">
</head>
<body>
<div ui-view class="main-body"></div>

<script src="assets/js/jquery-1.11.3.min.js"></script>
<!--Angular Library-->
<script src="angular/angular.min.js"></script>
<script src="angular/angular-ui-router.min.js"></script>

<script src="angular/angular-animate.min.js"></script>
<script src="angular/angular-aria.min.js"></script>
<script src="angular/angular-messages.min.js"></script>

<!-- Angular Material Library -->
<script src="assets/js/angular-material.min.js"></script>

<!--App Scripts-->
<script src="app/app.js"></script>
<script src="app/dashboard/dashboard.js"></script>
<script src="app/login/login.js"></script>
</body>
</html>

app.js file

angular.module('manoj', ['ui.router','ngMaterial'])
    .config(function ($mdThemingProvider, $locationProvider, $stateProvider, $urlRouterProvider) {
        $mdThemingProvider.disableTheming();
        $locationProvider.hashPrefix('');

        $urlRouterProvider.otherwise('/a/dashboard');
        $stateProvider
            .state('login',{
                url:'/login',
                templateUrl:'app/login/index.html',
                controller: 'loginCtrl'
            })
            .state('a',{
                url:'/a',
                templateUrl:'app/app.html'
            })
            .state('a.dashboard',{
                url: '/dashboard',
                templateUrl: 'app/dashboard/dashboard.html',
                controller:'dashboardCtrl'
            });
    }).run(function ($rootScope, $state, $stateParams){
        $rootScope.$state = $state;
        $rootScope.$stateParams = $stateParams;

    });

Please somebody help me...

1

There are 1 answers

0
Arjun Nile On

You need to update ui-router, try with "angular-ui-router 1.0.3"