Skip to content

Instantly share code, notes, and snippets.

@diproart
Created November 15, 2014 18:40
Show Gist options
  • Select an option

  • Save diproart/3e02dcaf0845edb3d663 to your computer and use it in GitHub Desktop.

Select an option

Save diproart/3e02dcaf0845edb3d663 to your computer and use it in GitHub Desktop.
(function(window, angular, undefined){
"use strict";
var ctrl = angular
.module('app')
.directive('userName')
.directive('userEmail')
.directive('userPassword')
.controller('RegisterCtrl', [
'$scope', '$log', '$state', 'User'
function($scope, $log, $state, User){
$log.log('RegisterCtrl');
$scope.credentials = {};
$scope.register = function(){
User.create($scope.credentials,
function(user){
// do staff
},
function(err){
$scope.$emit('error',err);
})
};
$scope.resetForm = function(){
$scope.credentials = {};
};
}
])
;
})(window, window.angular);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment