.controller(‘LoginCtrl’, function($scope,$state,$http,$ionicPopup) {
$scope.loginn = function(){
var usuario = this.usuario; // asi se revise valores de html
var contrasena = this.contrasena;
$http.get(‘http://localhost:8000/exonerados/loginapp/’+usuario+’/’+contrasena+’’)
.success(function (response)
{
var valor = parseInt(response);
if(valor===1){
$ionicPopup.alert({
title: ‘Bienvenido’,
template: usuario
});
$state.go(‘app.sistemas’);
}else{
$ionicPopup.alert({
title: ‘Error’,
template: ‘Datos incorrectos’
});
$state.go(‘inicio’);
}
});
}
})
.controller(‘SistemasCtrl’, function($scope, $stateParams) {
})
Good day, I need to be able to use the user variable throughout the application, is there a way to achieve this?