angular-directus

0.2.2 • Public • Published

Angular Directus

Angular wrapper for Directus Javascript SDK

Instalation

Install the package via npm: npm install angular-directus

Setup

var ngDirectus = require('angular-directus');
require('angular').module('demo', [ngDirectus]);

Include ngDirectus module

require('angular').module('demo', [ngDirectus]);

Initialize Directus

require('angular').module('demo')
  .config(['directusConfigProvider', function(directusConfigProvider) {
    directusConfigProvider.init(URL, KEY, VERSION);
  }]);

Example use in controller, get Items from Table

require('angular').module('demo')
    .controller('DemoController', [directus',  function(directus) {
        directus.getItems(TABLE).then(function(response){
            console.log(response);
        },function(error){
            console.error(error);
        });
    }]);

Check the official Directus documention for all getting endpoints https://api.getdirectus.com/1.1/#Getting_Data

Package Sidebar

Install

npm i angular-directus

Weekly Downloads

0

Version

0.2.2

License

MIT

Last publish

Collaborators

  • cydstumpel
  • shoogland
  • dipsausdennis
  • silvandiepen