Simple directive to trigger a UserVoice widget. It automatically loads the UserVoice widget for you as well.
bower install uservoice-trigger-directive
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
})
;
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.
<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>
To execute all the tests, just run:
npm test