ngx-m-print
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Simple library for print in angular

Install npm i ngx-m-print

Import into main module

import {NgxMPrintModule} from 'ngx-m-print';
 
@NgModule({
 
imports: [NgxMPrintModule]
 
})
export class AppModule {
}

Add directive to template

<div lib-ngx-m-print [printElement]="true"> 
  <!--Element you WANT to print-->
</div>

<div lib-ngx-m-print [printElement]="false"> 
  <!--Element you DON'T WANT to print-->
</div>
 
<button print>Print</button>

Print button should have 'print' directive.

Button with print directive can co-exist with lib-ngx-m-print. So you can hide the button from print preview like this.

<button lib-ngx-m-print [printElement]="false" print>Print table</button>

This is a component acting and used as a directive (similar to button in Material button)

Printed element looks the same as in your app.

Queries?

If you have any queries or complaints, please write it to my email. harichshore@gmail.com

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ngx-m-print

    Weekly Downloads

    6

    Version

    0.1.0

    License

    none

    Unpacked Size

    39.6 kB

    Total Files

    18

    Last publish

    Collaborators

    • harrymax1706