0

append data to new window or page but doesn't work !!! here is my function!

$scope.makeBooking = function makeBooking(id){

     $http({
            method: 'POST',
            url: 'booking',
            data: JSON.stringify(result),
            headers : { 'Content-Type': 'application/json' } ,// set the headers so angular passing info as form data (not request payload)
        }).success(function (data, status, headers, config) {
             $scope.window = $window.open('priceview','_blank');
             $scope.test = "asdfasddfas";

          angular.element($scope.window.document.body).append($compile($element.contents())($scope));

         }).error(function (data, status, headers, config) {

         });

   }

in new windows in html :

<div id="content" ng-controller="FlightController">
<h2 class="text-center">  Report Page</h2>
 {{scope.test}}
 {{$scope.test}}
 {{$scope}}
 {{scope}}
 {{test}}
 </div>

but doesn't work !just open new tab and data is miss!

Mohsen
  • 1,295
  • 1
  • 15
  • 45
  • i have something like this with my response data in new windows [http://jsfiddle.net/Amh8W/2/] – Mohsen Aug 13 '15 at 06:47
  • check here http://stackoverflow.com/questions/21519113/angularjs-open-a-new-browser-window-yet-still-retain-scope-and-controller-and – LHH Aug 13 '15 at 06:57
  • i'm googling a lot but everything i found is like there is no way to append data to view or pass data to that page if found the answer press the answer button thanks! – Mohsen Aug 13 '15 at 09:11

0 Answers0