
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
ngx-print-element
Advanced tools
This library is built to provide a solution for printing on html elements.
This library is built to provide a solution for printing on html elements.
This is the stackblitz.
Install ngx-print-element
from npm
:
npm install ngx-print-element --save
Add wanted package to NgModule imports:
import { NgxPrintElementModule } from 'ngx-print-element';
@NgModule({
imports: [
NgxPrintElementModule,
]
})
Need to import css
@import '~ngx-print-element/styles.css';
Printing data sheet with id is up to you.
If somewhere you don't want to display you can use class print-none
<table id="demo">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr class="print-none">
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
<ngx-print-element #element="element">
<button (click)="element.print('demo')">Print</button>
</ngx-print-element>
<table id="demo">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr class="print-none">
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
<ngx-print-element #element="element">
<button (click)="element.print('demo', {printMode: 'template', pageTitle: 'Hello World'})">Print</button>
</ngx-print-element>
import { Component } from '@angular/core';
import { NgxPrintElementService } from 'ngx-print-element';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor(public print: NgxPrintElementService) {}
}
<p id="demo">Angular-Print</p>
<button (click)="print.print('demo')">Print</button>
Field | Description | Type | Default |
---|---|---|---|
htmlType | Set element type domObj ,text | string | 'domObj' |
printMode | Way of printing | string template ,template-popup | - |
pageTitle | Print title | string | - |
templateString | Print template | - | - |
popupProperties | Set the new window.open parameters | string | - |
stylesheets | Set the external style sheet for printing | - | - |
styles | Set the internal style sheet for printing | - | - |
Versions |
---|
Angular 13 |
Angular 12 |
Angular 11 |
Angular 10 |
Angular 9 |
Angular 8 |
Author: DaiDH
, Tel: 0845882882
MIT License. Copyright (c) 2021 DaiDH
FAQs
This library is built to provide a solution for printing on html elements.
The npm package ngx-print-element receives a total of 1,166 weekly downloads. As such, ngx-print-element popularity was classified as popular.
We found that ngx-print-element demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.