State 'x' is already defined AngularJS ui.

2019-07-22 05:23发布

I include a multi-step form in my projet, it works but I have an error on some others pages.

Here is the code I used to include the multi step form. Multi-Step form

And the error I have

Error: State 'uploadForm'' is already defined
at n (https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.10/angular-ui-router.min.js:7:6487)
at q.r [as state] (https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.10/angular-ui-router.min.js:7:7429)
at http://localhost:51506/js/app.js?v=636306308881195716&l=en&u=636306206076525625:11:10
at Object.invoke (http://localhost:51506/js/angular.js?v=636282972889242203&l=en&u=636306206076525625:41:295)
at callInvoke (http://localhost:51506/js/ocLazyLoad.js?v=636282972890662285&l=en&u=636306206076525625:317:55)
at _invokeQueue (http://localhost:51506/js/ocLazyLoad.js?v=636282972890662285&l=en&u=636306206076525625:322:29)
at _register (http://localhost:51506/js/ocLazyLoad.js?v=636282972890662285&l=en&u=636306206076525625:206:21)
at success (http://localhost:51506/js/ocLazyLoad.js?v=636282972890662285&l=en&u=636306206076525625:647:37)
at http://localhost:51506/js/angular.js?v=636282972889242203&l=en&u=636306206076525625:126:182
at m.$eval (http://localhost:51506/js/angular.js?v=636282972889242203&l=en&u=636306206076525625:140:367)

My app.js

var app = angular.module('myApp', ['ngSanitize', 'ui.bootstrap', 'fcsa-number', 'ui.tree', 'oc.lazyLoad', 'angular.filter', 'ngAnimate','ui.router']);

app.config(function ($stateProvider, $urlRouterProvider) {
debugger;
  $stateProvider
       // route to show our basic form (/form)
        .state('uploadForm', {
            url: '/uploadForm',
            templateUrl: 'templates/step_Form/form.html?v=' + new  Date().getDay()
        })

        // url will be nested (/form/profile)
        .state('uploadForm.upload', {
            url: '/upload',
           templateUrl: 'templates/step_Form/form-upload.html?v=' + new Date().getDay()
    })

        // url will be /form/interests
        .state('uploadForm.content', {
            url: '/content',
            templateUrl: 'templates/step_Form/form-content.html?v=' + new Date().getDay()
             })


        // catch all route
        // send users to the form page 
        $urlRouterProvider.otherwise('/uploadForm/upload');
    })

0条回答
登录 后发表回答