Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 970 Bytes

README.md

File metadata and controls

32 lines (19 loc) · 970 Bytes

AngularJS json rpc

This code is far from the repository from which it was forked. JSON-RPC-2.0 implementation for AngularJS.

For Usage see test.js.

An example JSFiddle is working here: http://jsfiddle.net/89D4b/1/

Instead of creating a new factory for handling jsonrpc request, this angular module (angular-json-rpc) creates a new shortcut just like $http.get, but is instead $http.jsonrpc;

This code is under WTFPL.

Author

Example usage:

In your module, import 'angular-json-rpc':

    angular.module('test-module-jsonrpc', ['angular-json-rpc'])

Then:

    //url, method, parameters, config
    $http.jsonrpc('url/to/jsonrpc/service', 'methodToCall', [1, 2, 3], {}).success(function(){}).error(function(){});

For more information on callacks, see $http.