$state.go() not working. ? Why.?

Hello. I can not make the page redirect. I did not quite solve the problem. Could you help. Where am I making mistakes. ?

.state('app.playlists', {
      url: '/playlists',
      views: {
        'menuContent': {
          templateUrl: 'templates/playlists.html',
          controller: 'PlaylistsCtrl'
        }
      }
    })

  .state('app.single', {
    url: '/playlists/:playlistId',
    views: {
      'menuContent': {
        templateUrl: 'templates/playlist.html',
        controller: 'PlaylistCtrl'
      }
    }
  });
.controller('PlaylistsCtrl', function($scope) {
  $scope.playlists = [
    { title: 'Reggae', id: 1 },
    { title: 'Chill', id: 2 },
    { title: 'Dubstep', id: 3 },
    { title: 'Indie', id: 4 },
    { title: 'Rap', id: 5 },
    { title: 'Cowbell', id: 6 }
  ];
})

.controller('PlaylistCtrl', function($scope, $stateParams,$state) {

      $scope.id = $stateParams.playlistId;

      switch ($scope.id) {
         case 1:
          $state.go('app.italian_opening');

           break;
         case 2:
          $state.go('app.vienna_opening');
           break;
         default:

           break;
       }
});

it should be $state.go(‘app.playlists’); where is your routing for ‘app.italian_opening’ ??

I’m sorry. It’s is other code.

  .state('app.italian_opening', {
    url: '/italian_opening',
    views: {
      'menuContent': {
        templateUrl: 'templates/italian_opening.html',
        controller: 'italianCtrl'
      }
    }
  })

  .state('app.italian_opening_list', {
    url: '/italian_opening_list/:code/:number',
    views: {
      'menuContent': {
        templateUrl: 'templates/trapDetay.html',
        controller: 'italianTuzakCtrl'
      }
    }
  })

try this one:


$location.path('/italian_opening');

Not working. What can I do. ?

Not working again. Simple code but not running.