javascript - How to open browser wondow and pass HTML content? -
by click on button "push" need open new window , pass html content display it.
here view display html:
here controller defenition:
var test = angular.module('test', []); test.controller('testcontroller', ['$compile', '$scope','$window', function($compile, $scope, $window) { $scope.openwindow = function() { $window.open('to-print', 'width=500,height=400'); };}]);
here html content:
<div ng-app="test" id = "content" ng-controller="testcontroller"> <label>entar name:</label> <label>michael</label> <br/> <br/> <label>entar age:</label> <label>25</label> <hr/> <button ng-click="openwindow()">push!</button> </div>
and html want display inside opened window is:
<label>entar name:</label> <label>michael</label> <br/> <br/> <label>entar age:</label> <label>25</label>
here fiddle.
how can implement it?
Comments
Post a Comment