Closed itswillta closed 4 years ago
We need to have a common place to avoid initializing esnApiClient mutiple times in our code. Something like this will be cool:
const Client = require('esn-api-client/src/Client').default; angular.module('esn.api-client', []) .factory('esnApiClient', function($q, $window) { return new Client({ baseURL: $window.location.origin, customPromise: $q }); });
And then in our AngularJS code we just use it as a normal AngularJS dependency, without having to constructing Client multiple times.
Client
We need to change the code here also: https://github.com/OpenPaaS-Suite/esn-dav-import-client/blob/efdb044809dc60cd8986c94121dadee842920d55/src/ESNDavImportClient.js
We need to have a common place to avoid initializing esnApiClient mutiple times in our code. Something like this will be cool:
And then in our AngularJS code we just use it as a normal AngularJS dependency, without having to constructing
Client
multiple times.