New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-alert-provider

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-alert-provider

Angular provider used to display modal window. Allows to create simply modal window with buttons e.g. 'yes/no'. Based on angular bootstrap.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

angular-alert-provider

Angular Bootstrap modal window encapsulated in angular provider.

Compatibility

  • Angular: >1.2.28
  • Angular-bootstrap: ~0.14.3

Installation

Download plugin

bower install angular-alert-provider --save-dev

Add lib into script

<script type="text/javascript" src="../bower_components/angular-alert-provider/dist/alertProvider.min.js"></script>

Include provider into angular module dependency:

angular.module('App', ['$alertProvider']);

Ustage

  $scope.openModal = function () {
    var actionYes = function () {
      console.log('clicked yes');
    };

    var actionNo = function () {
      console.log('clicked no');
    };

    var alert = $alertProvider.open({
      title: 'Modal title',
      body: 'Do you confirm deleting element?',
      buttons: [
        {
          label: 'Yes',
          cssClass: 'btn btn-primary',
          action: actionYes
        },
        {
          label: 'No',
          cssClass: 'btn btn-danger',
          action: actionNo
        }
      ]
    });
  };

Result:

alt tag

Example

Install external dependencies

bower install
npm install

Run grunt command in order to serve example page on http://localhost:3001 host.

grunt serve

Options

  • Provider allows to use angular bootstrap options (documentation)

  • title (required): Title of modal dialog.

  • body (required): Body of modal dialog.

  • buttons (required): Collection of buttons:

    • label: - button label.
    • cssClass: - css class of button.
    • action: - callback triggered once clicked on button.
buttons: [
  {
    label: 'Yes',
    cssClass: 'btn btn-primary',
    action: actionYes
  },
  {
    label: 'No',
    cssClass: 'btn btn-danger',
    action: actionNo
  }
]
  • templateUrl (optional): Provider allows to change tempalate. Here you can set different template url in order to change structure of modal.

Release notes

  • 0.1.0 First version.
Licence MIT
Author: Tomasz Czechowski

Keywords

FAQs

Package last updated on 21 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc