2017-03-25 1 views
0

이미 stackoverflow에서 확인했는데 중복 게시물이 있지만 아무도 내 문제를 해결하지 못했습니다. 대부분의 경우 문제는 $ 상태의 주입입니다. 하지만 난 이미 내 컨트롤러에 주입하고 여전히 동일한 문제가 발생했습니다.

내 코드 : App.js는

var app = angular.module('app', [ 
    'wizardControllers', 
    'claimDataService', 
    'ui.router' 
]); 

app.config(function($stateProvider, $urlRouterProvider){ 
    // Otherwise 
    $urlRouterProvider.otherwise("/flight-details"); 
    $stateProvider 

    .state('flight-details', { 
     url: "/flight-details", 
     controller: 'FlightDetailsController', 
     templateUrl: "partials/flight-details.html" 
    }) 
    .state('flight-problem', { 
     url: "/flight-problem", 
     controller: 'FlightProblemController', 
     templateUrl: "partials/flight-problem.html" 
    }) 

}); 

컨트롤러 :

var wizardControllers = angular.module('wizardControllers', ['ngAnimate']); 

wizardControllers.controller('FlightDetailsController', ['$scope','$state','$http','claimDataService', function ($scope,$state,$http,claimDataService){ 

    $scope.claim = {}; 
    $scope.claim_data = claimDataService.get(); 

    $scope.nextStep = nextStep; 




    function nextStep(){ 
     claimDataService.set($scope.claim); 

     $scope.$state.go("flight-problem");//Giving Me the error 
    } 

}]); 

답변

1

$state 전에 $scope을 제거,이

$state.go("flight-problem");//Working fine 
시도
관련 문제