Buttons that require a second click to confirm sensitive action. Bye bye modals and alerts!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
dist
src
test
.gitignore
.jshintrc
.npmignore
.travis.yml
LICENSE
README.md
bower.json
gulpfile.js
karma.conf.js
package-lock.json
package.json

README.md

ng-really

Build Status

Modals and alerts are annoying. Opt for a simpler, more discreet and yet just as safe system: action button that morphs into a confirmation button.

Demo

Installation

Install via bower:

bower install ng-really

And include the script in your HTML:

<script src="../bower_components/ng-really/dist/ng-really.min.js"></script>

Usage

Add ng-really as a dependency to your app:

angular.module('yourApp',[
  'ngReally'
]);

Then, just set ng-really attributes on the element triggering the action you want a confirmation for (usually, a button):

<button type="button" class="btn btn-danger" ng-really ng-really-confirm-label="Really?" ng-really-confirmed-action="confirmedAction()" ng-really-timeout="1000">Delete</button>

Available attributes

  • ng-really-confirm-label (Type: string, Example: Really?): Label showing when the user clicks the first time.
  • ng-really-confirmed-action: Function to execute when the user clicks a second time.
  • ng-really-timeout: (Type: number, Example: 1000, optional): Number of milliseconds until the element returns to its initial state after first click. If not provided, the element waits forever for the second click.

Development

Install Gulp via npm if you don't have it

npm install -g gulp

Available commands

  • gulp: build and test the project
  • gulp build: build the project and make new files in dist
  • gulp serve: start a server to serve the demo page and launch a browser then watches for changes in src files to reload the page
  • gulp test: run tests
  • gulp serve-test: runs tests and keep test browser open for development. Watches for changes in source and test files to re-run the tests