Skip to content
A simple implementation of sweet-alert-dialog by @pedant to work on Nativescript
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
platforms/android
.gitignore
.npmignore
LICENSE
README.md
index.d.ts
index.js
package.json

README.md

ns-sweet-alert

an implementation of sweet alert dialog for nativescript

Fill in a little about your plugin!

License

This plugin is licensed under the MITlicense by Tomas

Based on

Android: sweet-alert-dialog by @pedant iOS: (wip) SweetAlert-iOS by @codestergit

Current State

For now you can do not so many things but i will be adding new stuff in the next days.

Installation

To install type

tns plugin add ns-sweet-alert

Usages

Once added into the project In your main-page.js like file do something like this

var app = require('application');
var SweetAlert = require('ns-sweet-alert');

var alertNice = function() {
  SweetAlert.simpleAlert(app.android.foregroundActivity).setTitleText("hey!").setContentText("this is a sweetmessage");
}

var inError = function(args) {
  SweetAlert.errorAlert(app.android.foregroundActivity).setTitleText("Oops!").setContentText(args);
}

exports.alertNice = alertNice;
exports.inError = inError;

Current Types

simpleAlert(context)
errorAlert(context)
warningAlert(context)
successAlert(context)

//you can use various methods with the dialog result
.setTitleText
.setContentText
.setConfirmText

I will be continue adding more things, like iOS support sometime this week!

And that's it!

Enjoy it.

You can’t perform that action at this time.