ng-notify:用于AngularJS应用的轻量级通知模块
ng-notify:用于AngularJS应用的轻量级通知模块。
一个简单,轻量级模块用于在你的AngularJS app中展示消息通知。
包括JS 和CSS文件大约只有4kbs
经测试支持IE8+和最新版本的Chrome, FireFox 和Safari。
Requirements
AngularJS is the only dependency. Animation is achieved with pure JS, jQuery not necessary.
Installation
You can install ng-notify with Bower.
bower install ng-notify --save
You can also download source files straight from this repo, they're located in thedistdir. Just include the minified version of both js and css files.
Usage
After including ng-notify.min.js and ng-notify.min.css, inject the ng-notify provider into your project.
var app = angular.module('demo', ['ngNotify']);
Now you can trigger notifications from anywhere in your app. To display a notification, just use thesetmethod.
ngNotify.set('Your notification message goes here!');
To specify the type of notification to display, provide the optional type param. (For available types, check the definitions below.)
ngNotify.set('Your error message goes here!', 'error');