Closed alex-mos closed 9 years ago
This is a good idea, and one I have been thinking about myself as well. I'll add this feature soon.
This request has been implemented.
Here is how to use it:
.module('MyApp', ['angular-jsonrpc-client'])
.config(function(jsonrpcConfigProvider) {
jsonrpcConfigProvider.set({
servers: [
{
name: 'first',
url: 'http://example.com:8080/rpc'
},
{
name: 'second',
url: 'http://example.net:4444/api'
}
]
});
})
.controller('MyController', ['$scope', 'jsonrpc', function($scope, jsonrpc) {
jsonrpc.request('first', 'version', {})
.then(function(result) {
$scope.result = result;
})
.catch(function(error) {
$scope.error = error;
});
}]);
Enjoy!
Thank you. Hunky-dory!
I need to use multiple json-rpc servers (for example: authorization and rating). It's not possible in current library. Please, add support of url as request parameter. Example: