![](/img/trans.png)
[英]Building a Single Page Application with AngularJS and Sitecore (SPA)
[英]create a link for a single page application (SPA) to land on different tab
我的解決方案是使用 URL 重寫,因此您仍會登陸 SPA 頁面,但使用不同的 URL。 路由引擎將選擇它並加載正確的模板。
.NET web.config 示例。
<rule name="NewsByEmail">
<match url="^newsbyemail/" />
<action type="Rewrite" url="/app/newsbyemail/index.html" />
</rule>
<rule name="NewsByEmailUnsubscribe">
<match url="^newsbyemail/unsubscribe/" />
<action type="Rewrite" url="/app/newsbyemail/index.html" />
</rule>
角度路由。
myApp.config(
($routeProvider, $locationProvider) => {
$routeProvider
.when("/newsbyemail/", {
templateUrl: "app/newsbyemail/subscribe/subscribe.html"
}).when("/newsbyemail/unsubscribe/", {
templateUrl: "app/newsbyemail/unsubscribe/unsubscribe.html"
});
$locationProvider.html5Mode(true);
}
);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.