• Stars
    star
    255
  • Rank 159,729 (Top 4 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 10 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple standalone AngularJS module with extensive features that provides growl-style alerts and messages for your app!

Angular Toasty

Angular Toasty is a simple standalone AngularJS module with extensive features that provides growl-style alerts and messages for your app.

Demo

Check it out!

Current Features

  • 3 Themes (Default, Material Design & Bootstrap 3)
  • Global/Individual timeouts
  • Shaking Toasts
  • Toaster sound
  • onAdd, onRemove & onClick event handlers
  • Event broadcasting
  • Positioning
  • HTML allowed

Installation

Install from Bower:
bower install angular-toasty
Add dependancies to HTML (AngularJS required)
<link href="./bower_components/angular-toasty/dist/angular-toasty.min.css" rel="stylesheet" />

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<script src="./bower_components/angular-toasty/dist/angular-toasty.min.js"></script>
Add the toasty module to your Angular app:
angular.module('app', ['angular-toasty']);
Add the toasty directive:
		<toasty></toasty>
	</body>
</html>
Inject and use the toasty service in your controllers:
angular.module('app').controller('UserCtrl', ['$scope', 'toasty', function($scope, toasty) {
	$scope.addUser = function(user) {
		// ...
		// Add user
		// ...
		toasty.success({
			title: 'User added!',
			msg: user.firstName + ' has been added!'
		});
}]);

Each toast must have at least a title or message.

Configuration

The default toasty config:

* limit: 5, // {int} Maximum number of toasties to show at once
showClose: true, // {bool} Whether to show the 'X' icon to close the toasty
clickToClose: false, // {bool} Whether clicking the toasty closes it
* position: 'bottom-right', // {string:bottom-right,bottom-left,top-right,top-left,top-center,bottom-center} The window position where the toast pops up
timeout: 5000, // {int} How long (in miliseconds) the toasty shows before it's removed. Set to false to disable.
sound: true, // {bool} Whether to play a sound when a toast is added
html: false, // {bool} Whether HTML is allowed in toasts
shake: false, // {bool} Whether to shake the toasts
theme: 'default' // {string} What theme to use; default, material or bootstrap

Config items marked with * cannot be overridden at an individual level

Global Overrides

To globally override the above config, simply inject the toastyProvider into your app at config:

angular.module('app').config(['toastyConfigProvider', function(toastyConfigProvider) {
	toastyConfigProvider.setConfig({
		sound: false,
		shake: true
	});
}]);

You can also get the global config at any time by calling toasty.getGlobalConfig()!

Individual Overrides

To override the global config for individual toasts, simply pass them into the creation object:

toasty({
	title: 'Ping!',
	msg: '<a href="http://google.com">Take me to Google!</a>',
	showClose: false,
	clickToClose: true,
	timeout: 10000,
	sound: false,
	html: true,
	shake: true,
	theme: 'bootstrap'
});

Features

Clearing/Removing

You can easily clear/remove a toast from the view by calling the clear method. To remove all at once, just call the method with no ID.

toasty.clear(); // Clear all 
toasty.clear(id); // Remove a single toast by it's ID
Toast Types

There's multiple types of toast to use:

toasty(); // Default
toasty.info();
toasty.success();
toasty.wait();
toasty.error();
toasty.warning();

To create a "quick toast", just pass a string or integer to the function instead:

toasty('Quick Toast!');
toasty.success('Quick Success Toast!');
Event Handlers & Broadcasting

You can easily hook into individual toast item events by calling a functions:

toasty({
	title: 'New Toast!',
	onAdd: function() {
		console.log('Toasty ' + this.id + ' has been added!', this);
	},
	onRemove: function() {
		console.log('Toasty ' + this.id + ' has been removed!', this);
	},
	onClick: function() {
		console.log('Toasty ' + this.id + ' has been clicked!', this);
	}
});

Toasty also broadcasts on events which can be hooked into:

// When a new toast is added
$rootScope.$on('toasty-added', function(event, toast) { console.log(toast) });
// When a toast is clicked
$rootScope.$on('toasty-clicked', function(event, toast) { console.log(toast) });
// When a toast is cleared/removed
$rootScope.$on('toasty-cleared', function(event, toast) { console.log(toast) });

Contributing

Please see the contributing guidelines.

More Repositories

1

react-native-firebase

๐Ÿ”ฅ A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
JavaScript
11,690
star
2

rdash-angular

AngularJS implementation of the RDash admin dashboard theme
HTML
4,686
star
3

react-native-material-design

React Native UI Components for Material Design
JavaScript
3,151
star
4

notifee

โš›๏ธ A feature rich notifications library for React Native.
TypeScript
1,841
star
5

react-native-apple-authentication

A React Native library providing support for Apple Authentication on iOS and Android.
JavaScript
1,407
star
6

react-native-firebase-starter

DEPRECATED: For RNFB v5 only.
JavaScript
1,172
star
7

melos

๐ŸŒ‹ A tool for managing Dart projects with multiple packages. With IntelliJ and Vscode IDE support. Supports automated versioning, changelogs & publishing via Conventional Commits.
Dart
1,155
star
8

react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
TypeScript
688
star
9

react-native-material-design-demo

An Android app to demonstrate react-native-material-design
JavaScript
494
star
10

react-native-notifee

Moved to https://github.com/invertase/notifee
TypeScript
465
star
11

docs.page

Instant Open Source docs with zero configuration.
TypeScript
463
star
12

firestore-ios-sdk-frameworks

โšก Precompiled Firestore iOS SDKs extracted from the Firebase iOS SDK repository release downloads for faster build times.
Ruby
444
star
13

stripe-firebase-extensions

Repository of Firebase Extensions built by Stripe.
TypeScript
437
star
14

react-query-firebase

React Query hooks for managing asynchronous operations with Firebase. Supports Authentication, Analytics, Firestore & Realtime Database.
TypeScript
390
star
15

denque

The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries.
JavaScript
353
star
16

dart_edge

Run Dart on the Edge - supporting Vercel & Cloudflare Workers (more coming soon).
Dart
321
star
17

zapp.run

Zapp! A free online sandbox environment for building Flutter applications in the browser.
Dart
318
star
18

spec

โœ… A streamlined testing framework for Dart & Flutter.
Dart
302
star
19

dart_custom_lint

๐Ÿ’ก Easily write powerful Dart & Flutter lint rules for your projects or for users of your packages.
Dart
283
star
20

react-native-firebase-docs

DEPRECATED: For RNFB v5 only.
190
star
21

flutterfire_cli

A CLI to help with using FlutterFire in your Flutter applications.
Dart
172
star
22

github-action-dart-analyzer

A GitHub action to run Dart analyzer with annotation support.
TypeScript
168
star
23

react-native-firebase-authentication-example

An example React Native Firebase application integrating authentication.
TypeScript
141
star
24

conference-app

Dart
126
star
25

globe

๐ŸŒŽ The global deployment platform for Dart & Flutter applications.
Dart
124
star
26

dart_firebase_admin

๐Ÿ”ฅ A Firebase Admin SDK for Dart.
Dart
119
star
27

jet

โœˆ๏ธ Test your React Native modules e2e; mock-free and native testing code free.
TypeScript
98
star
28

react-native-gradle-plugin

A gradle plugin for React Native Android that simplifies and standardises build configurations (such as dependency versioning) for Projects & React Native modules.
Groovy
64
star
29

dart_docker

๐Ÿ‹ A Dart client for the Docker API via local unix socket.
Dart
45
star
30

flutter_desktop_webview_auth

WebView OAuth flows for desktop flutter apps
C++
34
star
31

dart_firebase_apis

๐Ÿ”ฅ Generated Firebase APIs for Dart. Additionally Includes private and unlisted APIs.
Dart
29
star
32

puppeteer-pool

Flexible Puppeteer Browser instance resource pooling.
JavaScript
29
star
33

nodejs-paddle-sdk

A fully typed Node.js library for integration with Paddle.
TypeScript
28
star
34

firebase-extensions

A collection of Firebase Extensions built by Invertase.
TypeScript
28
star
35

deeps

Performant utilities to manage deeply nested objects. get, set, flatten, diff etc.
JavaScript
26
star
36

dart-cli-utilities

โš’๏ธ A monorepo containing a collection of packages that provide useful functionality for building CLI applications in Dart.
Dart
21
star
37

samples

Collection of samples from our projects and tutorials.
Dart
20
star
38

cluster-key-slot

Generates CRC hashes for strings - for use by Node Redis clients to determine key slots.
JavaScript
19
star
39

genkit-samples

Invertase genkit samples
TypeScript
18
star
40

react-native-firebase-workshop-app

Showcasing React Native + Firebase
TypeScript
13
star
41

sails-firebase-auth

A SailsJS v1 JSON starter api with Firebase token authentication.
JavaScript
10
star
42

crc16

Native node addon to calculate CRC16 values.
C++
10
star
43

firebase-firestore-fields

Convert Firebase Cloud Firestore fields into a usable JavaScript format
JavaScript
10
star
44

react-native-auto-link-example

Init a React Native project with auto-linking ๐Ÿ”ฅ
Objective-C
10
star
45

react-native-template

Generic template for Invertase React Native projects
Objective-C
9
star
46

genkit-plugins

TypeScript
9
star
47

nodejs-google-java-format

Node.js repackaging of Google's native `google-java-format` tool.
JavaScript
8
star
48

remix-firebase-storage-file-handler

An upload handler for Remix using Firebase Storage
TypeScript
8
star
49

a2a

Async await to Array -> `const [error, value] = await A2A(fooPromise());`
JavaScript
7
star
50

dart_globe_examples

Repository containing various Dart examples for Globe.
6
star
51

firebase-extension-utilities

TypeScript
6
star
52

nx-dart

A Nx plugin, that adds support for developing Dart and Flutter packages in a Nx workspace.
TypeScript
6
star
53

babel-preset-react-native-syntax

๐Ÿ“ฆBabel preset providing syntax only plugins used by babel-preset-react-native - supports React Native ^0.56.0.
JavaScript
5
star
54

firebase-relationship

A simple Firebase Realtime Database relationship manager.
JavaScript
5
star
55

genkit-plugin-redis

A Redis Plugin for GenKit that adds Redis for efficient state storage, trace storage, caching, and rate limiting.
TypeScript
5
star
56

firebase-emulator-action

Shell
4
star
57

sails-ioredis

Redis adapter for waterline with sentinel and cluster support support (ioredis)
JavaScript
4
star
58

tutorials

๐ŸŽ“ A collection of open-source tutorials by us and the open-source community covering topics such as React Native and Firebase.
4
star
59

balanced-employee-ip-agreement

An English law and Open Source friendly Balanced Employee IP Agreement - providing a balanced approach to assigning control of intellectual property (IP) created by UK company employees. See releases for PDF/MD files
4
star
60

flutterfire_ui

Dart
3
star
61

wtfork

Subscribe to and publish events between parent and child node processes using the standard node event emitter api or call parent methods directly from the child process and vice versa.
JavaScript
3
star
62

redis-writable

Fast conversion of commands and args to redis protocol writables.
JavaScript
3
star
63

firebase-functions-python-old

[WIP] Firebase SDK for Cloud Functions and Python.
Python
3
star
64

llm-gcp

Python
3
star
65

extensions-quickstart-js

Firebase Extensions quick start examples
TypeScript
3
star
66

firebase_performance_flutter_example

Testing
Dart
2
star
67

meta

General guidelines and documentation for the Invertase GitHub org.
1
star
68

ios-sdk-10-issues

iOS SDK 10 Firebase Storage issues
Objective-C
1
star
69

react-custom-event

React hook for window CustomEvent
JavaScript
1
star
70

docker-react-native-firebase-android

Dockerfile
1
star
71

oss-discord-community

Nothing to see here.
1
star
72

.github

Default community health files for Invertase.
1
star