0.5.2 • Published 7 years ago
swipeable-toasts v0.5.2
Installation & Usage
After installing the component via npm install, simply add the files to your app.module.ts
import {SwipeableToastComponent, SwipeableToastModule, SwipeableToastProvider} from "swipeable-toasts";
@NgModule({
declarations: [
...
],
imports: [
...,
SwipeableToastModule
],
bootstrap: [IonicApp],
entryComponents: [
...,
SwipeableToastComponent
],
providers: [
...,
SwipeableToastProvider
]
})Modify app.html for global usage of SwipeableToasts.
<swipeable-toast-component></swipeable-toast-component>
<ion-nav [root]="rootPage"></ion-nav>Call the showToast() method by injecting the SwipeableToastProvider
constructor(private swipeableToastProvider: SwipeableToastProvider) { ... }Define options and show toasts:
let toastOptions = {
message: "This is a very important message.",
messageType: MessageType.SUCCESS,
duration: 3000,
cssClass: "custom-css",
margin: 20
};
this.swipeableToastProvider.showToast(toastOptions);Choose between different message types
MessageType.ERROR
MessageType.WARNING
MessageType.INFO
MessageType.SUCCESSOptions
| Option | Type | Description |
|---|---|---|
| message | string | The displayed message |
| messageType | enum | Adds predefined styles to the toasts. |
| duration | number? | Defines, how long a Toast will be shown, before disappears |
| cssClass | string? | Name of a custom CSS class (e.g. for custom colors) |
| margin | number? | Defines a margin, which might help for adjusting the toasts in your app. |
0.5.2
7 years ago
0.5.1
7 years ago
0.5.0
8 years ago
0.4.3
8 years ago
0.4.2
8 years ago
0.4.1
8 years ago
0.4.0
8 years ago
0.3.24
8 years ago
0.3.23
8 years ago
0.3.22
8 years ago
0.3.21
8 years ago
0.3.20
8 years ago
0.3.19
8 years ago
0.3.18
8 years ago
0.3.17
8 years ago
0.3.16
8 years ago
0.3.15
8 years ago
0.3.14
8 years ago
0.3.13
8 years ago
0.3.12
8 years ago
0.3.11
8 years ago
0.3.10
8 years ago
0.3.9
8 years ago
0.3.8
8 years ago
0.3.7
8 years ago
0.3.6
8 years ago
0.3.5
8 years ago
0.3.4
8 years ago
0.3.3
8 years ago
0.3.2
8 years ago
0.3.1
8 years ago
0.3.0
8 years ago
0.2.8
8 years ago
0.2.7
8 years ago
0.2.6
8 years ago
0.2.5
8 years ago
0.2.4
8 years ago
0.2.3
8 years ago
0.2.2
8 years ago
0.2.1
8 years ago