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!