【发布时间】:2016-05-26 11:09:12
【问题描述】:
我正在创建一个应用程序,让登录用户能够在他们的仪表板中创建投票(包含问题和选择)。
创建投票后,我想重定向到投票页面,该页面将具有唯一的 url(例如:http://example.com/p/3eRr4g6)。
我希望此页面不使用仪表板模板。
如何做到这一点?
更新:显示我当前的索引文件以及我的结构。 (回复koox00的回复)
<body class="hold-transition skin-purple sidebar-mini">
<div class="wrapper">
<div ng-include="'components/navbar/navbar.html'"></div>
<div ng-include="'components/sidebar/sidebar.html'"></div>
<div class="content-wrapper">
<div ui-view></div>
</div>
<div ng-include="'components/footer/footer.html'"></div>
</div>
</body>
【问题讨论】:
-
创建的页面是动态的还是静态的?
-
统计民意调查数据时动态,将在用户投票时填充。
-
您认为您可以使用
$window.location.href = 'http://example.com/p/3eRr4g6';并在该页面上使用自定义模板吗? -
这是个好问题。我目前正在使用 $location 重定向到页面。我将不得不测试你的理论。我能看到的唯一问题是我将丢失我的 $scope 数据(身份验证等)。
-
你用
ui-router吗?
标签: angularjs node.js express angular-ui-router