Fatih Kızmaz 262e18f409 fix(native-spinner): update pluginRef (#1859)
Wrong pluginRef causes errors:
Native: tried calling SpinnerDialog.show, but the SpinnerDialog plugin is not installed.
Install the SpinnerDialog plugin: 'ionic cordova plugin add cordova-plugin-native-spinner'

Fix pluginRef to work properly.
2017-08-23 19:41:03 -04:00

60 lines
1.5 KiB
TypeScript

import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
export interface SpinnerDialogIOSOptions {
overlayOpacity?: number;
textColorRed?: number;
textColorGreen?: number;
textColorBlue?: number;
}
/**
* @name Spinner Dialog
* @description
* @usage
* ```typescript
* import { SpinnerDialog } from '@ionic-native/spinner-dialog';
*
* constructor(private spinnerDialog: SpinnerDialog) { }
*
* ...
*
* this.spinnerDialog.show();
*
* this.spinnerDialog.hide();
* ```
* @interfaces
* SpinnerDialogIOSOptions
*/
@Plugin({
pluginName: 'SpinnerDialog',
plugin: 'cordova-plugin-native-spinner',
pluginRef: 'SpinnerDialog',
repo: 'https://github.com/greybax/cordova-plugin-native-spinner',
platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows']
})
@Injectable()
export class SpinnerDialog extends IonicNativePlugin {
/**
* Shows the spinner dialog
* @param title {string} Spinner title (shows on Android only)
* @param message {string} Spinner message
* @param cancelCallback {boolean|function} Set to true to set spinner not cancelable. Or provide a function to call when the user cancels the spinner.
* @param iOSOptions {object} Options for iOS only
*/
@Cordova({
sync: true
})
show(title?: string, message?: string, cancelCallback?: any, iOSOptions?: SpinnerDialogIOSOptions): void { }
/**
* Hides the spinner dialog if visible
*/
@Cordova({
sync: true
})
hide(): void { }
}