Change of state is not working


#1

Greetings everyone, i have this simple code of login for an user, the PHP query works great and the controller process also is working good but i defined a state to change when success but is no working, The code is:

(function (){

var app = angular.module('starter', ['ionic']);
var app2 = angular.module('nuevo', []);

app.controller('controller', function($scope, $http, $state) {

$scope.registrar = function(){
    $http.post("http://127.0.0.1:8080/php/Conexion.php",{
        correo:$scope.mail, pass:$scope.word,    
    }).success(function(data){
        alert("SESIÓN INICIADA")
        $state.go('main');
    });
}

});

  app.config(function($stateProvider, $urlRouterProvider) {

$stateProvider
  .state('main', {
    url: '/main',
    templateUrl: 'templates/main.html',
    controller: 'controller',
  })

$urlRouterProvider.otherwise('/index.html');
  });

The network log shows the page but not in my app, i’m glad to hear your suggestion about this.

Thank you for your time