简体   繁体   中英

AngularJS ui.router. One state not working

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'
          }
        }
      })
}])

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM