Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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

```html
Contact
Vote
Vote
```

## Running Tests

To execute all the tests, just run:

```
npm test
```