重新加载页面给出“Can not GET /dashboard/a@b.com” - angular ui-routing

时间:2016-10-07 02:26:26

标签: angularjs node.js angular-ui-router

这是州:

.state('userDashboard', {
  url : '/dashboard/:email',
  templateUrl : '/templates/dashboard.html',
  controller : 'dashboard'
 })

这就是我达到这种状态的方式:

$state.go("userDashboard", {email : data.email})

现在当我在这个页面上时,网址看起来很像:

http://localhost:3000/dashboard/a@b.com

问题:当我重新加载此网址(http://localhost:3000/dashboard/a@b.com)时,我收到此错误:

Cannot GET /dashboard/a@b.com

P.S:当我将网址更改为localhost:3000/#/dashboard/a@b.com时,网页会正确加载,并且网址会自动更改为http://localhost:3000/dashboard/a@b.com

请帮我解决。

编辑: - 我在前端使用角度,在后端使用nodejs。

0 个答案:

没有答案