AngularJS ui.router. One state not working

Issue

I have little problem. I want to go from forum-en to main-en. And I can’t go. From forum to main works, from main-en to main works. I can’t find any mistakes. Here my app.config.js file:

    $stateProvider
      .state('main', {
        url: '/',
        views: {
          '': {
            templateUrl: './views/main.html',
          },
          'footer': {
          template: 'Mano rankų darbas © 2018 - Klaipėda'
          }
        }
      }).state('main-en', {
        url: '/en',
        views: {
          '': {
          templateUrl: './views/en.main.html',
          },
          'footer': {
          template: 'Handmade by me © 2018 - Klaipėda'
          }
        }
      }).state('forum', {
        url: '/forum',
        views: {
          '': {
            templateUrl: './views/forum.html',
          },
          'footer': {
            template: 'Mano rankų darbas © 2018 - Klaipėda'
          }
        }
      }).state('forum-en', {
        url: '/forum-en',
        views: {
          '': {
            templateUrl: './views/en.forum.html',
          },
          'footer': {
            template: 'Handmade by me © 2018 - Klaipėda'
          }
        }
      })
}])

Solution

I found how to fix, maybe it’s not best solution, but it works for me fine 🙂 I changed my links. It was data-ui-sref=”/en” and I changed it to href=”/en”.

Answered By – Free-dev

Answer Checked By – Timothy Miller (AngularFixing Admin)

Leave a Reply

Your email address will not be published.