我在我的项目中包含一个多步骤表单,它可以正常工作但我在其他页面上有错误。
以下是我用于包含多步表单的代码。 Multi-Step form
我有错误
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)
我的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');
})