API service update

This commit is contained in:
tmshv committed 2016-02-24 19:10:42 +03:00
1 parent 56045a1b03
commit ca415e58de
4 files changed
+20 -18

No files matched your search

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