• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

eu81273/angular.snackbar: Pure AngularJS based Material Design Snackbars

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

eu81273/angular.snackbar

开源软件地址(OpenSource Url):

https://github.com/eu81273/angular.snackbar

开源编程语言(OpenSource Language):

JavaScript 51.1%

开源软件介绍(OpenSource Introduction):

Angular Snackbar

Pure AngularJS based Snackbar Component. (css based on https://github.com/FezVrasta/snackbarjs)

Example

jsFiddle - http://jsfiddle.net/eu81273/wtfdzehr/

Installation

Copy the script and css into your project and add a script and link tag to your page.

<script type="text/javascript" src="/angular.snackbar.js"></script>
<link rel="stylesheet" type="text/css" href="css/angular.snackbar.css">

Add a dependency to your application module.

angular.module('myApp', ['angular.snackbar']);

And add snackbar container tag to your application.

<div class="snackbar-container" data-snackbar="true"></div>

This is all.

some attributes of angular snackbar are below.

  • snackbar: snackbar directive.
  • snackbar-duration : snackbar duration time (ms).
  • snackbar-remove-delay : delay time to remove from DOM after hide (ms).

Create snackbar

Creating snackbar also very simple. Inject snackbar service to your app then call the service method like below.

var app = angular.module('angularApplication', ['angular.snackbar']);

app.controller('defaultController', function($scope, snackbar) {

	//create snackbar with default duration(3000ms)
	snackbar.create("Hello World!!");
	
	//create snackbar with custom duration
	snackbar.create("This is snackbar!!", 5000);

});

Browser Compatibility

Report me please. I just tested on Chrome 39.0.2171.95 m.

Changelogs

version 1.0.1

  • Reduce extra digest loops when hide (Thanks to codef0rmer)

version 1.0.0

License

The MIT License.

Copyright ⓒ 2015 AHN JAE-HA.

See LICENSE




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap