0.5.2 • Published 6 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.SUCCESS
Options
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
6 years ago
0.5.1
6 years ago
0.5.0
6 years ago
0.4.3
6 years ago
0.4.2
6 years ago
0.4.1
6 years ago
0.4.0
6 years ago
0.3.24
6 years ago
0.3.23
6 years ago
0.3.22
6 years ago
0.3.21
6 years ago
0.3.20
6 years ago
0.3.19
6 years ago
0.3.18
6 years ago
0.3.17
6 years ago
0.3.16
6 years ago
0.3.15
6 years ago
0.3.14
6 years ago
0.3.13
6 years ago
0.3.12
6 years ago
0.3.11
6 years ago
0.3.10
6 years ago
0.3.9
6 years ago
0.3.8
6 years ago
0.3.7
6 years ago
0.3.6
6 years ago
0.3.5
6 years ago
0.3.4
6 years ago
0.3.3
6 years ago
0.3.2
6 years ago
0.3.1
6 years ago
0.3.0
6 years ago
0.2.8
6 years ago
0.2.7
6 years ago
0.2.6
6 years ago
0.2.5
6 years ago
0.2.4
6 years ago
0.2.3
6 years ago
0.2.2
6 years ago
0.2.1
6 years ago