5.1.0 • Published 8 years ago

uservoice-trigger-directive v5.1.0

Weekly downloads
10
License
MIT
Repository
github
Last release
8 years ago

uservoice-trigger-directive

Build Status Dependency Status devDependency Status NPM version

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

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 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

<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
5.1.0

8 years ago

5.0.0

9 years ago

4.0.0

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago

0.1.3

9 years ago