API service update
This commit is contained in:
1 parent
56045a1b03
commit
ca415e58de
4 files changed
+20
-18
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import APIFeed from './APIFeed';
|
||||
import APIGallery from './APIGallery';
|
||||
import APIDocument from './APIDocument';
|
||||
import APICollective from './APICollective';
|
||||
|
||||
export default class API {
|
||||
constructor(request) {
|
||||
this.news = new APIFeed(request);
|
||||
this.gallery = new APIGallery(request);
|
||||
this.document = new APIDocument(request);
|
||||
this.collective = new APICollective(request);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import APIFeed from './APIFeed';
|
||||
import APIGallery from './APIGallery';
|
||||
import APIDocument from './APIDocument';
|
||||
import APICollective from './APICollective';
|
||||
|
||||
export default function (app) {
|
||||
app.factory('api', function ($http) {
|
||||
let api = {};
|
||||
api.news = new APIFeed($http);
|
||||
api.gallery = new APIGallery($http);
|
||||
api.document = new APIDocument($http);
|
||||
api.collective = new APICollective($http);
|
||||
|
||||
return api;
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user