如何在AngularJS中跳过ui-router's ui-view并重定向不带.html扩展名的部分url

How to skip ui-router's ui-view and redirect partial url without .html extension in AngularJS

本文关键字:重定向 html 扩展名 url ui-view AngularJS ui-router      更新时间:2023-09-26

在尝试使用以下内容从主页导航时,它将我重定向到具有.html扩展名的页面。

<a href="playplug.html"></a>
/example.com/playplug.html

如何实际跳过在URL中使用. HTML扩展名的部分模板如下所示,使用/不使用ui-viewcos,我想导航到一个单独的HTML页面,不需要在home_page (example.com)中显示部分模板。

/example.com/playplug

通常,ui-router的ui-view允许我在主页中显示部分模板;是否有类似这样的东西来重写ui-router的ui-view或任何其他调整…我是AngularJS新手

<a href="playplug.html" url="/playplug"></a>

你所能做的就是把完整的URL。这在大多数情况下都有效。

请看下面的例子:https://github.com/reflexdemon/ng-gulp/blob/master/src/app/home/home.html L4

看这里的演示:http://demo-venkatvp.rhcloud.com//home