Skip to content

Instantly share code, notes, and snippets.

View lukichev's full-sized avatar
🏠
Working from home

Andrew Lukichev lukichev

🏠
Working from home
View GitHub Profile
angular
.module('jindy.auth')
.factory('httpInterceptors', httpInterceptorsFactory);
httpInterceptorsFactory.$inject = ['$rootScope', '$injector', '$q'];
function httpInterceptorsFactory($root, $injector, $q) {
return {
request : function(config) {
let Authentication = $injector.get('Authentication');
class ChatController {
/** @ngInject */
constructor($root, $stateParams, $log, $interval, $timeout, Authentication, MessageService, SocketService) {
var self = this;
this.$root = $rootScope;
this.$stateParams = $stateParams;
this.$log = $log;
this.$interval = $interval;
this.$timeout = $timeout;
app.get('/register', function(req, res) {
var user, email;
UserModel.create(req.params)
.then(function(user) {
return user.createToken();
})
.then(function(token) {
return sendGreetingEmail(user.email);
})