This angularjs extension is a simple wrapper around the UserVoice API. To install the component in your existing angular app follow these steps:
bower install ng-helper-user-voice --save
angular.module('appApp', [
'ngHelperUserVoice'
]);
As preparation the module requires an non secure API token form user voice. Visit the admin portal in the settings under integrations and create a non trusted api client.
.config(function ($uservoiceProvider) {
$uservoiceProvider.setSubDomain("<<YOUR SUBDOMAIN>>");
$uservoiceProvider.setApiKey("<<YOUR API TOKEN>>");
$uservoice.openTicket("YOUR NAME", "YOUR EMAIL", "YOUR SUBJECT", "YOUR MESSAGE").then(function(ticketId) {
alert("Ticket with id: " + ticketId + " created");
}).catch(function(error) {
alert("Error: " + error);
});
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :)