angular-owlbot-wrapper

0.0.2 • Public • Published

npm version GitHub issues GitHub license

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

  1. Install via npm or downloaded files:
    1. via npm: npm install --save angular-owlbot-wrapper
    2. via downloaded files
  2. Add angular-owlbot-wrapper to your application's module dependencies.
  3. Include dependencies and angular-owlbot-wrapper in your HTML.
    • When using npm
    <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>
  4. Set your Owlbot API token in your config script with the owlbotServiceProvider.setToken function.
  5. 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

Package Sidebar

Install

npm i angular-owlbot-wrapper

Weekly Downloads

3

Version

0.0.2

License

MIT

Unpacked Size

7.94 kB

Total Files

8

Last publish

Collaborators

  • basklein