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
+12 -4
View File
@@ -25,7 +25,9 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
repo: 'https://github.com/WebEngage/cordova-plugin',
platforms: ['Android', 'iOS']
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class Webengage extends IonicNativePlugin {
/**
* Initializes WebEngage SDK
@@ -79,7 +81,9 @@ export class Webengage extends IonicNativePlugin {
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.user'
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class WebengageUser extends IonicNativePlugin {
/**
* Logs user in
@@ -120,7 +124,9 @@ export class WebengageUser extends IonicNativePlugin {
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.push'
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class WebengagePush extends IonicNativePlugin {
/**
* Callback function is invoked when a push notification is clicked
@@ -152,7 +158,9 @@ export class WebengagePush extends IonicNativePlugin {
plugin: 'cordova-plugin-webengage',
pluginRef: 'webengage.notification'
})
@Injectable()
@Injectable({
providedIn: 'root'
})
export class WebengageNotification extends IonicNativePlugin {
/**
* Callback function is invoked when a in-app notification is shown