mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user