[英]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.