@melonwd/melonalert
v1.4.5
Published
The purpose of this repo and library is to swap out functionality provided by SweetAlert2 at transpile time and provide Nativescript friendly code/views.
Downloads
25
Keywords
Readme
MelonAlerts
The purpose of this repo and library is to swap out functionality provided by SweetAlert2 at transpile time and provide Nativescript friendly code/views.
Installation
Install the package with
npm install @melonwd/melonalert
and then in the correct tsconfig.json
you need to define the following path:
"sweetalert2":[
"node_modules/@melonwd/melonalerts"
]
After this, whenever you require
or import
something from sweetalert2
it will instead grab the member out of the melonalerts library instead.
Usage
Once the above has been done, you should be able to use swal normally (with limited functionality.)
You need to import MelonAlertModule
and place it within your app.module.ts.
You need to put <mwd-alert></mwd-alert>
in the root of your project.
Supported Alert Flags
title
- Title of which to be shown in the alert
text
- Text to be shown underneath the paragraph
confirmButtonText
- Text shown on the confirmation button
cancelButtonText
- Text shown on the cancellation button
showConfirmButton
- If the confirmation button should display.
showCancelButton
- If the cancellation button should display.
cancelButtonStyle
- Object of styles to apply to the cancellation button.
confirmButtonStyle
- Object of styles to apply to the confirmation button.