JSPM

angular-toast

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q30077F
  • License ISC

Angular factory for creating small toast pop ups

Package Exports

  • angular-toast

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular-toast) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

angular-toast

Live Demo!

I couldn't find a toast library that fit my needs and was reasonably small, so I ended up building one with a dead simple API and decided to share it. There is a low frame .gif at the bottom

NPM

Installation

Installation is super easy, simply add the dependencies to your build, inject it and call the toast.show() method.

# use npm
$ npm install angular-toast

Add angular-toast to your dependencies

angular
  .module('yourApp', ['angular-toast'])
  .controller('SampleController', function ($scope, toast) {

    $scope.test = function (text) {
      return toast.show(text || 'Example')
    }

  })

API

toast.show(text, timeout)

The first parameter is your custom message, and the second optional parameter is a custom timeout in milliseconds (default is 4 seconds)

Low frame gif