Variables between cotroller


.controller(‘LoginCtrl’, function($scope,$state,$http,$ionicPopup) {
$scope.loginn = function(){
var usuario = this.usuario; // asi se revise valores de html
var contrasena = this.contrasena;
.success(function (response)
var valor = parseInt(response);
title: ‘Bienvenido’,
template: usuario
title: ‘Error’,
template: ‘Datos incorrectos’



.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?


You can read about creating service


just go with the localstorage its may help you


Hi! Look, you have some options to variables between controller, some bad choices, but…
you can:

  • Create services
  • Pass with $broadcast, $on,
  • $window, window
  • $rootScope