2017-03-25 7 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 
を試してみてください
関連する問題