Last active
August 29, 2015 14:09
-
-
Save ondrek/c7089772ab22401c1744 to your computer and use it in GitHub Desktop.
Samples for Code Styles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(){ | |
/** | |
* Recovery Controller provides functionality for: | |
* (1) resetting password, (2) setting a new one and (3) switching views | |
*/ | |
'use strict'; | |
var RecoveryController = function($scope, $location, Auth){ | |
var self = this; | |
self.errors = {}; | |
self.user = {}; | |
self.onLoggedUser(Auth, $location); | |
}; | |
RecoveryController.prototype.onLoggedUser = function(Auth, $location){ | |
var self = this; | |
this.submitted = true; | |
if(this.$valid) { | |
var loginOnRequest = Auth.login({ | |
email: self.user.email, | |
password: self.user.password | |
}); | |
loginOnRequest.then(function() { | |
$location.path('/'); | |
}); | |
loginOnRequest.catch(self.onInvalidForm); | |
} | |
}; | |
RecoveryController.prototype.onInvalidForm = function(){ | |
}; | |
angular.module('webApp').controller('RecoveryCtrl',[ | |
'$scope', '$location', 'Auth', RecoveryController | |
]); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(){ | |
/** | |
* Live betting templates and downlading data from the API | |
* Provides all routing for the Live Module | |
*/ | |
'use strict'; | |
var configuration = function ($routeProvider){ | |
$routeProvider.when(lib.urls.LIFE_ROOT, { | |
templateUrl: lib.templates.LIVE_LIST | |
}); | |
$routeProvider.when(lib.urls.LIVE_WILDCARD, { | |
templateUrl: lib.templates.LIVE_DETAILS | |
}); | |
}; | |
angular.module('webApp').config(configuration); | |
})(); |
Author
ondrek
commented
Nov 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment