<commit_before>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 = '//widget.uservoice.com/7283example27291.js';
	})
	.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
<a uservoice-trigger mode="contact">Contact</a>
<a uservoice-trigger mode="smartvote" position="top">Vote</a>
<a uservoice-trigger mode="smartvote" position="top" identify="identify">Vote</a>
```


## Running Tests

To execute all the tests, just run:

```
npm test
```<commit_msg>Fixed example in readme to js api key<commit_after>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
<a uservoice-trigger mode="contact">Contact</a>
<a uservoice-trigger mode="smartvote" position="top">Vote</a>
<a uservoice-trigger mode="smartvote" position="top" identify="identify">Vote</a>
```


## Running Tests

To execute all the tests, just run:

```
npm test
```
{'fraction_non_alphanumeric': 0.14267515923566879, 'fraction_numerical': 0.001910828025477707, 'mean_word_length': 5.349056603773585, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '431021', 'n_tokens_mistral': 1508, 'n_tokens_neox': 1432, 'n_words': 402}