简体   繁体   English

与app.single一起使用多个状态

[英]using multiple states with app.single

Hi I just want to know if I can use multiple states with app.single. 嗨,我只是想知道我是否可以对app.single使用多个状态。 My app shows blank when adding another state using app.single, but if I remove it the app shows again. 使用app.single添加其他状态时,我的应用显示为空白,但是如果我将其删除,则应用会再次显示。

app.js
.state('app.checkin', {
      url: "/checkin",
      views: {
        'menuContent': {
          templateUrl: "templates/checkin.html",
          controller: 'CheckinCtrl'
        }
      }
    })

  .state('app.single', {
    url: "/checklist",
    views: {
      'menuContent': {
        templateUrl: "templates/checklist.html",
        controller: 'ChecklistCtrl'
      }
    }
  })

  .state('app.single', {
    url: "/checkekstra",
    views: {
      'menuContent': {
        templateUrl: "templates/checkekstra.html",
        controller: 'CheckekstraCtrl'
      }
    }
  });

let me know if my question is vague, thank you. 让我知道我的问题是否含糊,谢谢。

In ui-router a state name is like an identifier. 在ui路由器中,状态名称就像标识符。 You can't name two routes with the same state name. 您不能使用相同的州名来命名两条路由。

I'm pretty sure that if you check your browser javascript console you'll see an error. 我非常确定,如果您检查浏览器的JavaScript控制台,将会看到错误。 (And that's why it show you a blank page). (这就是为什么它向您显示空白页的原因)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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