From 401c58e2fa1a96bdb34cacd7cc6214487192d97c Mon Sep 17 00:00:00 2001 From: Evan Moore Date: Sat, 5 May 2018 22:41:17 -0400 Subject: [PATCH] add some documentation on how to use this --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index d919f15..4d339ba 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,30 @@ # cordova-zebra-printer A Cordova plugin for Zebra printers for both iOS and Android with Ionic 3 bindings + +To use with Ionic 3 + +Add the Ionic 3 bindings to your app.module.ts file +``` +import { ZebraPrinter } from 'ca-cleversolutions-zebraprinter/native'; +... +providers: [ + ZebraPrinter, + ... +``` + +Then inject the ZebraPrinter into the constructor of the class where you wish to use it +for example +``` +constructor(public navCtrl: NavController, protected zebraPrinter:ZebraPrinter) { + console.log(">>>>>> Home Constructed <<<<<<<") + } + + protected discover(){ + console.log("Now Discover"); + this.zebraPrinter.discover().then(result => { + console.log(result); + }).catch(err => { + console.error(err); + }); + } +``` \ No newline at end of file