ng-notify:用于AngularJS應用的輕量級通知模塊

e2ex 9年前發布 | 35K 次閱讀 ng-notify Web框架 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');

項目主頁:http://www.baiduhome.net/lib/view/home/1431607237997

 本文由用戶 e2ex 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!