nativescript-printer icon indicating copy to clipboard operation
nativescript-printer copied to clipboard

Usage with angular, printScreen does not work without view arg

Open bufke opened this issue 5 years ago • 0 comments

Hello, it looks like printScreen() without any view arg doesn't work in angular based projects. let view: View = frame.topmost().currentPage.content; ends up being undefined. Passing the view explicitly works but has no example. This works:

@ViewChild("foo") foo: ElementRef;
printer.printScreen({ view: this.foo.nativeElement });

I could submit a PR just updating the documentation if you'd like. If we wanted to not fix the currentPage issue, we could just note that the view arg is required when using Angular.

bufke avatar Jan 01 '19 17:01 bufke