【问题标题】:Why is AngularFire Routing rendering blank pages为什么AngularFire路由呈现空白页面
【发布时间】:2014-10-06 07:55:39
【问题描述】:

我下载了 AngularFire 种子,我正在尝试更改我正在从事的项目的路线,但到目前为止我还没有成功。我只是将 '/home' 更改为 '/' 和 '/chat' 更改为 '/selectcard' 和 '/login' 更改为 '/cardcredentials' 因此,我也更改了 .html 的名称模板。

现在我在部署的应用程序中收到空白页。我已经倾注了角度 ngroute 文档,但我无法弄清楚我哪里出错了。

.constant('ROUTES', {
    '/': {
      templateUrl: 'partials/home.html',
      controller: 'HomeCtrl',
      resolve: {
        // forces the page to wait for this promise to resolve before controller is loaded
        // the controller can then inject `user` as a dependency. This could also be done
        // in the controller, but this makes things cleaner (controller doesn't need to worry
        // about auth status or timing of displaying its UI components)
        user: ['simpleLogin', function(simpleLogin) {
          return simpleLogin.getUser();
        }]
      }
    },
    '/SelectCard': {
      templateUrl: 'partials/selectcard.html',
      controller: 'ChatCtrl'
    },
    '/CardCredentials': {
      templateUrl: 'partials/cardcredentials.html',
      controller: 'LoginCtrl'
    },
    '/OffersDetails': {
      templateUrl: 'partials/offerdetails.html',
      controller: 'AccountCtrl',
      // require user to be logged in to view this route
      // the whenAuthenticated method below will resolve the current user
      // before this controller loads and redirect if necessary
      authRequired: true
    }
  })

【问题讨论】:

  • JS控制台打印什么错误信息?

标签: routes angularfire ngroute


【解决方案1】:

当您下载 angularfire 种子时,您必须进行凉亭安装。我不确定为什么这些不会自动安装,因为它们必须存在才能使应用程序正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-22
    • 1970-01-01
    • 1970-01-01
    • 2017-02-18
    • 1970-01-01
    相关资源
    最近更新 更多