ethstats-server/public/js/services.js

55 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-01-20 19:29:31 +01:00
'use strict';
/* Services */
app.factory('socket', function ($rootScope) {
2015-02-17 06:12:44 +01:00
var socket;// = new Primus();
return socket;
// return {
// on: function (eventName, callback) {
// socket.on(eventName, function () {
// var args = arguments;
// $rootScope.$apply(function () {
// callback.apply(socket, args);
// });
// });
// },
// emit: function (eventName, data, callback) {
// socket.emit(eventName, data, function () {
// var args = arguments;
// $rootScope.$apply(function () {
// if (callback) {
// callback.apply(socket, args);
// }
// });
// })
// }
// };
2015-01-28 23:38:54 +01:00
});
2015-02-17 11:14:48 +01:00
app.factory('toastr', function ($rootScope) {
toastr = window.toastr;
toastr.options = {
"closeButton": false,
"debug": false,
2015-02-18 07:06:41 +01:00
"progressBar": false,
2015-02-17 11:14:48 +01:00
"newestOnTop": true,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
return toastr;
});
2015-02-17 10:30:41 +01:00
var lodash = angular.module('lodash', []);
lodash.factory('_', function() {
2015-01-28 23:38:54 +01:00
return window._;
2015-01-20 19:29:31 +01:00
});