Skip to content

Instantly share code, notes, and snippets.

@talcual
Created November 30, 2019 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talcual/f8bbc16dd2b943a2c09f28bc42d9e047 to your computer and use it in GitHub Desktop.
Save talcual/f8bbc16dd2b943a2c09f28bc42d9e047 to your computer and use it in GitHub Desktop.
const ionApp = <HTMLElement>document.getElementsByTagName('ion-app')[0];
const startScanner = () => {
scanSub = this.qrScanner.scan().subscribe((text: string) => {
console.log(text);
});
this.qrScanner.show();
ionApp.style.display = 'none';
});
const closeScanner = () => {
this.qrScanner.hide();
scanSub.unsubscribe();
ionApp.style.display = 'block';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment