Giter VIP home page Giter VIP logo

tinycon-angularjs's Introduction

Tinycon Angularjs

An Angular service wrapper for tommoor's TinyCon library.

From the TinyCon README:

A small library for manipulating the favicon, in particular adding alert bubbles and changing images. Tinycon gracefully falls back to a number in title approach for browers that don't support canvas or dynamic favicons.

Documentation

Install angular-tinycon via Bower.

bower install tinycon-angularjs --save-dev

Include angular-tinycon.min.js in your application. The minified version already includes a version of Tincon so there is no need to include that file too.

<script src="components/tinycon-angularjs/dist/angular-tinycon.min.js"></script>

Add the module angularTinycon as a dependency to your application module.

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

You can set Tinycon's options in the app config.

app.config(function(anTinyconProvider){
    anTinyconProvider.setOptions({
        width: 7,
        height: 9,
        font: "10px arial",
        colour: "#ffffff",
        background: "#549A2F",
        fallback: true
    });
});

Take a look at Tinycon's README for all options

To use the API methods you have to call the anTinycon service in (for example) your controller.

API Documentation

###setBubble Change the value of the bubble

Usage: anTinycon.setBubble(number)

app.controller('MainCtrl', function($scope, anTinycon) {
  anTinycon.setBubble(number);
});

###reset Reset the favicon to its original state.

Usage: anTinycon.reset()

app.controller('MainCtrl', function($scope, anTinycon) {
  anTinycon.reset();
});

###bind Bind a $scope key to the bubble.

Usage: anTinycon.bind(scope, key)

app.controller('MainCtrl', function($scope, anTinycon) {
    // Define
    $scope.number = 10;

    // Bind
    anTinycon.bind($scope, 'number');
});

Tinycon will automatically update the bubble's value when your key's value changes.

Credits

All credits for Tinycon go to tommoor.

tinycon-angularjs's People

Contributors

dirkgroenen avatar barryvdh avatar simison avatar stevermeister avatar

Stargazers

Rahul Kalkani avatar Diego avatar Sebastien avatar Ilya Medvedev avatar Lu Frankland avatar Wojciech avatar Alex avatar

Watchers

James Cloos avatar  avatar  avatar

tinycon-angularjs's Issues

reset() function missing

Dear Dirk,

first of all thank you for the great wrapper, I'm currently using it in my project and came to the conclusion tinycon.reset() isn't available.

Is it possible to implement this (I tried pulling the source but when I build the files it came out completely different then the repo)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.