我有一个主视图和一个子视图。在子域中,我有一些子视图,但这些是动态加载的,即Round1,Round2,Round3 ....来自动态值它可能有5轮或4或3 ...如何动态加载这些状态?
angular
.module('myApp', ['ngResource', 'ngRoute', 'ui.router'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('main', {
url: '/main',
templateUrl: 'views/mainView.html',
controller: 'mainCtrl'
})
.state('main.submain', {
url: '/sub_main',
templateUrl: 'views/subMainView.html',
controller: 'subMainCtrl'
})
.state('main.submain.Round1', {
url: '/Round_One',
templateUrl: 'views/subView.html',
})
.state('main.submain.Round2', {
url: '/Round_Two',
templateUrl: 'views/subView.html'
})
.state('main.submain.Round3', {
url: '/Round_Three',
templateUrl: 'views/subView.html'
})
.state('main.submain.Round4', {
url: '/Round_Four',
templateUrl: 'views/subView.html'
})
.state('main.submain.Round5', {
url: '/Overall_Feedback',
templateUrl: 'views/Round5View.html'
})
$urlRouterProvider.otherwise('/login');
});