Create a nuxeo-angular Angular module to be able to easily use nuxeo-js-client inside an Angular application.
For now, nuxeo-angular will not use $http from Angular, but still relies on jQuery to do the HTTP calls.
All methods accepting a callback will be wrapped to expose Promises (through $q) to easily integrate it into an Angular application.
For instance, the following code:
client.connect(function(error, client) { if (error) { // cannot connect console.log('Client is not connected: ' + error); } // OK, the returned client is connected console.log('Client is connected: ' + client.connected); });
will become:
client.connect.then(function(client) { // OK, the returned client is connected console.log('Client is connected: ' + client.connected); }, function(err) { // cannot connect console.log('Client is not connected: ' + err); });