# angular-rt-popup
**Repository Path**: mirrors_rubenv/angular-rt-popup
## Basic Information
- **Project Name**: angular-rt-popup
- **Description**: A better version of the Bootstrap popover, for Angular.JS
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-18
- **Last Updated**: 2026-01-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# angular-rt-popup
> A better version of the Bootstrap popover, for Angular.JS
[](https://travis-ci.org/rubenv/angular-rt-popup)
## Installation
Add angular-rt-popup to your project:
```
bower install --save angular-rt-popup
```
Add it to your HTML file:
```html
```
Reference it as a dependency for your app module:
```js
angular.module('myApp', ['rt.popup']);
```
### Requirements
This module requires:
* Angular.JS (obviously)
* JQuery (mainly for `$.contains`)
## Usage
Use the `popup-show` directive to show a popup:
```html
Show popup!
```
This will load `popup.html` and show it in the popup. Use [Bootstrap](http://getbootstrap.com/) classes for styling the popup (I recommend that you load the Bootstrap CSS to make it look pretty).
Here's an example:
```html
Hello!
```
You can use `hidePopover()` inside the popup to hide the popover. Any click outside the popup also closes it.
### `popup-placement`
You can control the placement of the popup by adding a `popup-placement` attribute.
```html
Show popup!
```
Supported values: `right`, `left`, `bottom`, `bottom-left`, `top`.
### `popup-placement-fn`
A function that can control the placement of a popup based on the given screen location. It receives an anchor object and should return `right`, `left`, `bottom`, `bottom-left` or `top`.
The anchor object has the following properties: `top`, `left`, `width`, `height`.
If this function is defined it will override the placement attribute.
```html
Show popup!
```
```javascript
scope.placement = function (anchor) {
return anchor.left < $window.width / 2 ? "right" : "left";
};
```
### `popup-if`
Popups can be made conditional by adding a `popup-if` attribute. The popup will only be shown if the expression is true.
```html
Show popup!
```
### `popup-class`
Adds extra classes to the popover wrapper.
```html
Show popup!
```
### `popup-shown`
A function that will be called when the popup is shown.
```html
Show popup!
```
### `popup-hidden`
A function that will be called when the popup is hidden.
```html
Show popup!
```
### `popup-auto-show`
Will auto show the popup when it evaluates to true.
```html
Show popup!
```
### `popup-overlap`
You can control the overlap position with the anchor element by adding a `popup-overlap` attribute.
```html
Show popup!
```
## License
(The MIT License)
Copyright (C) 2014-2015 by Ruben Vermeersch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.