Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chesleybrown/uservoice-trigger-directive
Simple directive to trigger a UserVoice popup.
https://github.com/chesleybrown/uservoice-trigger-directive
Last synced: 15 days ago
JSON representation
Simple directive to trigger a UserVoice popup.
- Host: GitHub
- URL: https://github.com/chesleybrown/uservoice-trigger-directive
- Owner: chesleybrown
- License: mit
- Created: 2014-02-21T00:56:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-01T08:58:51.000Z (over 8 years ago)
- Last Synced: 2024-11-01T05:13:55.765Z (16 days ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 14
- Watchers: 2
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
uservoice-trigger-directive
===========================
[![Build Status](https://travis-ci.org/chesleybrown/uservoice-trigger-directive.svg?branch=master)](https://travis-ci.org/chesleybrown/uservoice-trigger-directive)
[![Dependency Status](https://david-dm.org/chesleybrown/uservoice-trigger-directive.svg)](https://david-dm.org/chesleybrown/uservoice-trigger-directive)
[![devDependency Status](https://david-dm.org/chesleybrown/uservoice-trigger-directive/dev-status.svg)](https://david-dm.org/chesleybrown/uservoice-trigger-directive#info=devDependencies)
[![NPM version](https://badge.fury.io/js/uservoice-trigger-directive.svg)](http://badge.fury.io/js/uservoice-trigger-directive)Simple directive to trigger a UserVoice widget. It automatically loads the UserVoice widget for you as well.
#### Install with Bower
```
bower install uservoice-trigger-directive
```#### Include the directive in your Angular module and config it
```js
var myApp = angular
.module('myApp', ['uservoice-trigger'])
.config(function ($userVoiceProvider) {
// you must set this to your unique UserVoice Javascript API Key which
// can be found under your UserVoice -> Settings -> Widgets section on
// their site
$userVoiceProvider.defaults.key = 'rarAZzmdEeibkRTbaRROi'; // this is only an example api key
})
.controller('MyCtrl', function (UserVoice) {
// Setup your UserVoice here, etc
})
;
```## Usage
Use the `uservoice-trigger` directive attribute on the element you want to trigger the UserVoice widget on click. You also can change the `mode` used by setting the `mode` attribute to one of `contact`, `smartvote` or `satisfaction` (see [UserVoice docs](https://developer.uservoice.com/docs/widgets/overview/) for more information on the widget options). It is also possible to set the `position` attribute to determine which direction the widget will appear (default is `automatic`).
**NOTE:** `uservoice-trigger` module now automatically loads the `UserVoice` widget, so you won't have to add it yourself anymore.
## Examples
## Running Tests
To execute all the tests, just run:
```
npm test
```