io service ES6 refactoring

This commit is contained in:
tmshv committed 2016-02-22 01:36:49 +03:00
1 parent c7cf73a6d1
commit 7594a14ad6
2 files changed
+6 -8

No files matched your search

+2 -1
View File
@@ -10,6 +10,7 @@ import AppController from './controllers/AppController';
import HomeController from './controllers/HomeController';
import TeamController from './controllers/TeamController';
import DocumentsController from './controllers/DocumentsController';
import IOService from './services/io';
import api from './api/api';
let deps = [
@@ -87,7 +88,7 @@ app.run(($location, $rootScope, $http) => {
[
api,
require('./services/io'),
IOService,
require('./directives/mainMenu'),
require('./directives/backgroundPicture'),
require('./ui/menu'),
+4 -7
View File
@@ -1,15 +1,12 @@
/**
* Created by tmshv on 15/03/15.
*/
export default function (app) {
let socket;
module.exports = function (app) {
var socket;
function init(){
socket = io();
}
app.service("io", function () {
app.service('io', () => {
if (!socket) init();
return socket;
});
};
};