Search Posts

Could not resolve ‘dashboardsAdmin’ from state ”

Whenever I click on my Sumbit button it doesn’t move to next page as it should be. My motto is to get into the next page using $state.go('') I have included all CDN files. I have included index.html ,controller.js as it sis shown below.

What I am doing wrong so that it is not moving to next page and giving this error

    Complete  Error  :- angular.js:13236 Error: Could not resolve 
        'dashboardsAdmin' from state ''
        at Object.transitionTo (angular-ui-router.js:3140 

       <div ng-controller="logInCtrl" layout="column" ng-cloak="" 
        class="inputErrorHeight">
                  <form class="form-horizontal" role="form" 
                            name="logInForm" id="logInFormData"
                              data-ng-init="init()">
                            <md-input-container class="md-block">
                                <input name="emailId" type="email"
                                       md-maxlength="50"
                                       placeholder="Email"
                                       ng-model="logInFormData.emailId"
                                       required
                            </md-input-container>  
                            <div style="text-align:center">
                                <md-button class="md-raised md-primary" ng-
                                   disabled="logInForm.$invalid" ng-
                                  click="submitLogInInfo()">Submit</md-
                                      button>
                            </div>
                        </form>
                    </md-content>
                </div>                
            </div>
            <!--Injection of nested pages-->
            <div ui-view></div>

            <!-- My config files-->
            function config($stateProvider, $urlRouterProvider, 
             $ocLazyLoadProvider, IdleProvider) {
                $urlRouterProvider.when('', '/');
                $ocLazyLoadProvider.config({
                    // Set to true if you Want to see what and when is 
                 dynamically loaded
                    debug: false
                });
                $stateProvider
                   .state('dashboardsAdmin', {
                        abstract: true,
                        url: "/dashboard-info",
                        cache: false,
                        controller: logInCtrl,
                        templateUrl: "views/adminDashboard.html"
                    })
            }
            angular.module('perspective') .config(config)                              
            //Controller file
            var app = angular.module('perspective', 
            ['ngRoute','ui.router',
              'ui.bootstrap']);
            function logInCtrl ($scope,$state){
                $scope.logInFormData ={}; 
                $scope.submitLogInInfo = function(){
                    $state.go('dashboardsAdmin');
                };
            app.controller('logInCtrl',logInCtrl);

Source: AngularJS

Leave a Reply

Your email address will not be published. Required fields are marked *