0.3.0 • Published 8 years ago

ng-surprise v0.3.0

Weekly downloads
33
License
-
Repository
github
Last release
8 years ago

ng-surprise v0.2.0

Code Climate Test Coverage Build Status

This is a AngularJS module to put Easter eggs in your application. Sometimes you need an Easter egg to allow your dev staff to skip some configuration step or close an uncloseable modal in your app. So, ng-surprise is an easy way to do that.

Demo

You can see ng-surprise in action on http://rafaelcamargo.github.io/ng-surprise

Installation

npm install ng-surprise --save

Once ng-surprise dependency is installed, declare the ngSurprise module as your app dependency:

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

Usage

Wherever in your application, you can inform an action and a trigger to be performed:

<div data-surprise="showSomething" data-surprise-trigger="38,38,38,37"></div>

Action

Should be a function in your scope:

$scope.showSomething = function(){
  alert('Gotcha!');
};

Trigger

Should be a sequence of keycodes to be performed by the user. It's not an Array. It should be necessarily a String with keycodes separeted by comma with no spaces between them. The event attribute responsible to inform which code user has performed is keydown. You can easily discover the keycodes you want to use as your trigger on the following page: http://www.w3.org/2002/09/tests/keys.html

Release History

  • 2015/08/09 v0.2.0 : Unit tests added
  • 2015/07/29 v0.1.0 : Initial release tests still in progress