AngularJS 상태를 사용하여 중첩 된 양식에서 다음 단추를 만들려고합니다. 같이 여기 내 설정은 다음과 같습니다AngularJS 상태 다음 단추
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('step', {
url: '/step',
templateUrl: 'form.html',
count: '0',
controller: 'formController'
})
.state('step.1', {
url: '/1',
count: '1',
templateUrl: 'form-1.html'
})
.state('step.2', {
url: '/2',
count: '2',
templateUrl: 'form-2.html'
})
.state('step.3', {
url: '/3',
count: '3',
templateUrl: 'form-3.html'
})
.state('step.4', {
url: '/4',
count: '4',
templateUrl: 'form-4.html'
});
$urlRouterProvider.otherwise('/step/1');
})
은 내가 NG 클릭 기능을 사용하고있는 상태 사이를 이동하려면 :
$scope.nextStep = $state.current.count;
$scope.nextStepCount = function() {
$scope.count = $scope.nextStep + 1;
$state.go('step.' + $scope.count);
}
내가 그것을 단계 "의 현재 경로를 변경 다음 버튼을 클릭합니다. 1 "에서"step.11 "로 변경됩니다.
문자열의 병합이 아닌 숫자 또한이 일어나고있는 것입니다. – Chris