ng-oboe

An AngularJS wrapper module for oboe.js.

Added by: Sam Deering

GitHub

Repository

jedd-ahyoung/ng-oboe

Stats

Stars: 5

Watchers: 5

Forks: 2

Module Description

ng-oboe

An Angular wrapper for Jim Higson's oboe.js, following Angular's $http module conventions. Thanks for Jim for creating such a cool library!

Usage:

To use ng-oboe, add the 'ng-oboe' module as an an app dependency.

angular.module('myApp', ['ng-oboe'])

With ng-oboe as an app dependency, we can now inject oboe into a controller, service, factory, etc. and call oboe methods.

.controller('myCtrl', function ($scope, oboe) {
    $scope.items = [];

    oboe.get('test.json')
        .start(function (data, etc) {
            console.log("Dude! We're goin'!", data, etc);
        })
        .node('items.*', function (value) {
            $scope.items.push(value);
        })
        .done(function (value) {
            console.log("It works! ", value);
        })
        .fail(function (error) {
            console.log("Error: ", error);
        });
        

This oboe wrapper supports GET, POST, PUT, PATCH, and DELETE, used just like the equivalent methods on the $http object. The oboe wrapper, once called with one of the methods above, will return an object exposing oboe's events (such as .on() and .node()).

NOTE: Due to angular conventions, oboe's .done() and .fail() functions are are also aliased to .success() and .error(), respectively. This (hopefully) should allow ng-oboe to serve as a drop-in replacement to $http without any code changes.

This library isn't ready for primetime yet, but it's usable to a certain extent. Please feel free to check it out!

Module stats last updated: 2015-05-27 01:21:22

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!