I'm having 2 HTML Views one is for application purpose and another one is for Printing purpose. Just consider the two file names Application.html and PrintForm.html
Sample HTML Script of Application.html
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}<br>
<br> Click here to <a href="#">Print</a>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
</script>
</body>
</html>
Sample HTML Script of PrintForm.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 class="visible">My First Name is {{ }}</h1>
<h1 class="visible">My Last Name is {{ }}</h1>
<p>The Value fetched from Application.html</p>
</body>
</html>
If I click the Print hyperlink from Application.html, I need to print PrintForm.html with data binded from app.controller
$scope
$scope.firstName = "John";
$scope.lastName = "Doe";
The expected output screen is
I don't need to load the Printing content into the browser, it directly trigger the Printer Dialog to print, after print hyperlink gets hit.
My expected action after hitting the Print Hyperlink in the Application.html should be as
Note: Don't use iFrame or any other inner View for the PrintForm.html
The Following Source Code will exactly satisfy your requirement.