io service ES6 refactoring
This commit is contained in:
1 parent
c7cf73a6d1
commit
7594a14ad6
2 files changed
+5
-7
No files matched your search
+2
-1
@@ -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'),
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/**
|
||||
* 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;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user