Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * App setup del proyecto, se registra el módulo y sus depenencias
- */
- var app = angular.module(App.MODULE_NAME, ['ngRoute', 'ngTasty', 'ngMaterial', 'ngAnimate','smart-table',/* 'satellizer'*/]);
- /*app.controller("SignUpController", SignUpController)
- app.controller("LoginController", LoginController);
- app.controller("LogoutController", LogoutController);
- function SignUpController($auth, $location) {
- var vm = this;
- this.signup = function() {
- $auth.signup({
- email: vm.email,
- password: vm.password
- })
- .then(function() {
- // Si se ha registrado correctamente,
- // Podemos redirigirle a otra parte
- $location.path("/private");
- })
- .catch(function(response) {
- // Si ha habido errores, llegaremos a esta función
- });
- }
- }
- function LoginController($auth, $location) {
- var vm = this;
- this.login = function(){
- $auth.login({
- Username: "julio",
- password: "ciancio"
- })
- .then(function(){
- // Si se ha logueado correctamente, lo tratamos aquí.
- // Podemos también redirigirle a una ruta
- $location.path("/private")
- })
- .catch(function(response){
- // Si ha habido errores llegamos a esta parte
- });
- }
- }
- function LogoutController($auth, $location) {
- $auth.logout()
- .then(function() {
- // Desconectamos al usuario y lo redirijimos
- $location.path("/")
- });
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement