1.0.0 • Published 12 months ago

@kovalenko/print-element v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

PrintElement

Prints selected element only

Installation

npm install @kovalenko/print-element

First, import the PrintElementModule to your module:

import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {PrintElementModule} from '@kovalenko/print-element';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppComponent} from './app';

@NgModule({
  imports: [
    BrowserModule,
    PrintElementModule
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
})
export class AppModule {
}

platformBrowserDynamic().bootstrapModule(AppModule);

Then use the directive to print an element:

import {Component} from '@angular/core';
import {MainMenuService} from '@kovalenko/main-menu';

@Component({
  selector: 'app',
  template: `
    <button [ngcPrintElement]="printable"></button>
    <div #printable>
      Printable element
    </div>
  `,
})
export class AppComponent { }

Directive

Selector: [ngcPrintElement]

Properties

NameDescription
@Input() ngcPrintElement: HTMLElementprintable element

License

MIT