https://github.com/gilf/ngprint
AngularJS directive to enable browser printing
https://github.com/gilf/ngprint
Last synced: 9 months ago
JSON representation
AngularJS directive to enable browser printing
- Host: GitHub
- URL: https://github.com/gilf/ngprint
- Owner: gilf
- License: mit
- Created: 2015-12-31T08:37:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-06-29T01:28:12.000Z (about 8 years ago)
- Last Synced: 2024-11-10T08:17:41.303Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 45
- Watchers: 10
- Forks: 47
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ngPrint
==============
AngularJS directive for browser printing.
Copyright (C) 2014, 2015, 2016 Gil Fink
Installation
------------
You can choose your preferred method of installation:
* Download from github: [ngPrint.min.js](https://github.com/gilf/ngPrint/blob/master/ngPrint.min.js)
Usage
-----
Include both **ngPrint.js** and **ngPrint.css** in your application.
```html
```
Add the module `ngPrint` as a dependency to your app module:
```js
var myapp = angular.module('myapp', ['ngPrint']);
```
### ng-print directive
Use the `ng-print` directive on a button to indicate that it is a print button.
Use the `print-element-id` attribute to indicate the id of the element you want to print.
For example, if you want to print the whole page you can wrap it in an element with the id of myPage and set the `print-element-id` attribute to myPage.
```html
Print
```
As shown in the Following Post:
-----
http://blogs.microsoft.co.il/gilf/2014/08/09/building-a-simple-angularjs-print-directive/
A working plnkr
-----
http://plnkr.co/edit/HkTTHfeLM8buwbWqHuOm?p=preview
License
----
Released under the terms of the [MIT License](LICENSE).