Skip to content

rfviolato/pagarme-ng-popover

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pagarme-ng-popover

Pagar.me's simple directive to provide pop-over functionality

Installation

Install via npm package manager:

$ npm install pg-ng-popover

Import the directive file into your project:

<script src="node_modules/pg-ng-popover/dest/pg-ng-popover.min.js"></script>

If you wish the same style of the example, import the css.

<link rel="stylesheet" type="text/css" href="dest/css/pg-ng-popover.min.css">

Load the pg-ng-popover module:

angular.module('myApp', ['pg-ng-popover']);

Call the directive in an element via attribute or tag name:

<div data-pg-ng-popover></div>
<pg-ng-popover></pg-ng-popover>

Pass the popover's content via attribute content: You can pass raw text or html content.

<div data-pg-ng-popover content="My awesome text or html here"></div>

Directive Optionals

Choose bottom positioning:

<div data-pg-ng-popover position="bottom" content="My awesome text or html here"></div>

You can also choose what event will trigger the popover hide/show:

• Click:

<div data-pg-ng-popover event-type="click" content="My awesome text or html here"></div>

Transitions

You can transition the hide/show states, but first of all you gotta tell the directive that you are going to transition it so opened class will be added:

<div data-pg-ng-popover transition="true" content="My awesome text or html here"></div>

And you can also choose the name of the class that will be added when the popover opens and will be removed when the popover hides (default id opened):

<div data-pg-ng-popover opened-class="my-custom-class" transition="true" content="My awesome text or html here"></div>

And that's it!

Rafael Violato @ pagar.me

About

Pagar.me's simple directive to provide pop-over functionality

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 49.8%
  • JavaScript 41.8%
  • HTML 8.4%