Skip to content

Instantly share code, notes, and snippets.

@ondrek
Last active August 29, 2015 14:09
Show Gist options
  • Save ondrek/2aacd0690a7bfa58a93b to your computer and use it in GitHub Desktop.
Save ondrek/2aacd0690a7bfa58a93b to your computer and use it in GitHub Desktop.
sample of controller boilerplate
;(function(){
/**
* The recovery controller provides functionality for:
* (1) resetting password,
* (2) setting a new one
* (3) and switching between views
*/
'use strict';
//////////////// controller
angular.module('webApp').controller('RecoveryCtrl',[
'$location', 'Auth', RecoveryController
]);
function RecoveryController($http, $location, $q, exception, logger){
var self = this;
self.onLostUserId = onLostUserIdForm;
self.onResetPassword = resetPasswordUsingToken;
self.onLostPassword = onLostPasswordForm;
};
//////////////// definitions
function onLostUserIdForm(submittedFormContent){
lib.log.info('User has requested User ID');
};
function LostPasswordForm(submittedFormContent){
lib.log.info('User has requested Password');
};
function resetPasswordUsingToken(submittedFormContent) {
lib.log.info('User has submitted Password');
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment