나는 초보자입니다. 여기에는 성공에서받은 응답을 다른 컨트롤러로 가져 가야하는 시나리오가 있습니다. 아래 코드를 시도했지만 목표를 달성 할 수 없습니다.한 컨트롤러에서 다른 컨트롤러로 resposne을 가져 오는 방법
코드 :
$scope.received = function(){
$http({
url : "/generic/getdata",
method : 'GET',
}).success(function(data) {
//The data received here I need t take to mydataController
$location.path('/success');
})
when('/success', {
templateUrl: 'ngtemplates/success/success.html',
controller: 'mydataController'
}).
app.controller('mydataController',
[ '$scope', '$http',function($scope, $http,$location) {
//I want the success data here in some function
}]);
제발, 나를