refactor: optimize plugins for angular treeshaking

BREAKING CHANGE: You can remove the plugin import from the app.module.ts because of the changed Inject decorator
This commit is contained in:
Daniel Sogl
2019-02-20 17:37:39 +01:00
parent 64230319a2
commit 8b53c04dc5
238 changed files with 735 additions and 245 deletions
+9 -3
View File
@@ -74,7 +74,9 @@ export interface NdefTag {
/**
* @{ NFC } class methods
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class NFC extends IonicNativePlugin {
FLAG_READER = {
NFC_A: 0,
@@ -311,7 +313,9 @@ export class NFC extends IonicNativePlugin {
* Do not pass bytes as parameters for these methods, conversion is built in.
* For usage with nfc.write() and nfc.share()
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Ndef extends IonicNativePlugin {
@CordovaProperty()
TNF_EMPTY: number;
@@ -423,7 +427,9 @@ export class Ndef extends IonicNativePlugin {
plugin: 'phonegap-nfc',
pluginRef: 'util'
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class NfcUtil extends IonicNativePlugin {
@Cordova({ sync: true })
toHex(i: number): string {