angular-owlbot-wrapper
Owlbot service for AngularJS
Description
This is a service for AngularJS that allows for easy requests to the Owlbot dictionary API.
Usage
- Install via npm or downloaded files:
- via npm:
npm install --save angular-owlbot-wrapper
- via downloaded files
- Add
angular-owlbot-wrapper
to your application's module dependencies. - Include dependencies and angular-owlbot-wrapper in your HTML.
<script src="node_modules/angular-owlbot-wrapper/dist/angular-owlbot-wrapper.min.js"></script>
- When using downloaded files
<script src="YOUR_PATH/angular-owlbot-wrapper.min.js"></script>
- Set your Owlbot API token in your config script with the owlbotServiceProvider.setToken function.
- Use the angular service
owlbotService
.
Sample
Javascript:
angular.module('app', ['angular-owlbot-wrapper']);
angular.module('angular-owlbot-wrapper').config(['owlbotServiceProvider', function (owlbotServiceProvider) {
owlbotServiceProvider.setToken('TOKENGOESHERE');
}]);
angular.module('app')
.controller('appController', function ($scope, owlbotService) {
$scope.getDefinition = function (word) {
return owlbotService.getDefinition(word).then(function (result) {
console.log(result);
return result;
});
};
});
LICENSE
MIT