From 68eaaf233887cf1bb70de5317c35a79f31cd4422 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Sat, 20 Feb 2016 17:04:54 +0300 Subject: [PATCH] api ES6 refactoring --- src/client/api/api.js | 12 +++--------- src/client/app.js | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/client/api/api.js b/src/client/api/api.js index d31dc0d1..605322c8 100644 --- a/src/client/api/api.js +++ b/src/client/api/api.js @@ -1,16 +1,10 @@ -/** - * Created by tmshv on 22/11/14. - */ - import APIFeed from './APIFeed'; import APIGallery from './APIGallery'; import APIDocument from './APIDocument'; -module.exports = function (app) { - var minute = 1000 * 60; - - app.factory("api", function ($http) { - var api = {}; +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); diff --git a/src/client/app.js b/src/client/app.js index f48d098d..7683352a 100644 --- a/src/client/app.js +++ b/src/client/app.js @@ -4,6 +4,7 @@ import Document from './components/Document'; import Award from './components/Award'; +import api from './api/api'; var deps = [ require('./modules/schedule') @@ -79,7 +80,7 @@ app.run(function ($location, $rootScope, $http) { }); [ - require("./api/api"), + api, require("./services/io"), require("./directives/mainMenu"), require("./directives/teamMemberProfile"),