如何使用Angular.js仅设置路径名

问题描述 投票:1回答:1

我很困惑要使用Angular.js设置路径。假设我最初的网址是http://localhost/crm/deal.php#/catagory

在此URL中,我只需要将deal.php#/catagory更改为dashboard.php。我正在使用ui-router路由状态。

angularjs angular-ui-router
1个回答
0
投票

需要注意的两件事是客户端路由,第二件事是服务器端路由。

如果HTML页面未与服务器端(PHP)紧密结合,那么最好使用有角的ui-router,它将仅在客户端上加载页面。在这里,通过查看URL / routs deal.php和dashboard.php,似乎它们需要在服务器上呈现。如果此声明正确,则ui-router不太适合此处。

但是,如果您正在使用ui-router进行操作,并且需要更多帮助,则以下链接可能会有所帮助:Redirect to login when user is not logged in or user tries to access page directly from URL using angularjs

© www.soinside.com 2019 - 2024. All rights reserved.