Change of state is not working


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(){
        correo:$scope.mail, pass:$scope.word,    
        alert("SESIÓN INICIADA")


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

  .state('main', {
    url: '/main',
    templateUrl: 'templates/main.html',
    controller: 'controller',


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