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;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
+2
-2
@@ -32,7 +32,7 @@ import Strip from './filters/Strip';
|
|||||||
import UppercaseFirst from './filters/UppercaseFirst';
|
import UppercaseFirst from './filters/UppercaseFirst';
|
||||||
import IOService from './services/io';
|
import IOService from './services/io';
|
||||||
import MenuService from './services/menu';
|
import MenuService from './services/menu';
|
||||||
import api from './api/api';
|
import API from './services/api';
|
||||||
|
|
||||||
let app = angular.module('hudozka', [
|
let app = angular.module('hudozka', [
|
||||||
'hudozhka.data',
|
'hudozhka.data',
|
||||||
@@ -104,7 +104,7 @@ app.run(($location, $rootScope, $http) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
[
|
[
|
||||||
api,
|
API,
|
||||||
IOService,
|
IOService,
|
||||||
MenuService,
|
MenuService,
|
||||||
RemoveHashtags,
|
RemoveHashtags,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import API from '../api/API';
|
||||||
|
|
||||||
|
export default function (app) {
|
||||||
|
app.factory('api', $http => new API($http));
|
||||||
|
};
|
||||||
Reference in new issue
Block a user