多个index.html页面角度 [英] Multiple index.html pages angular

查看:63
本文介绍了多个index.html页面角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是angular的新手,仍在决定是否要使用它.我希望在我的应用程序中有2个单独的基本"页面:一个经过身份验证的页面和一个未经身份验证的页面.它们具有具有不同内容区域的不同框架.因此,我不仅可以重定向到单独的部分,还可以重定向到整个html.

I'm brand new to angular, and am still deciding whether or not I want to use it. I'm looking to have 2 separate 'base' pages in my app: an authenticated one and an unauthenticated one. They have different skeletons with different content areas. So, I can't just redirect to separate partials, but rather an overall html.

  • 是否可以使用2个应用程序,其中1个用于index1.html,一个用于index2.html?

  • 是否有更简单的方法来做到这一点?还是这不是为angular构建的?

推荐答案

您可以使用 ngInclude 有条件地更改页面各个部分的内容.这样,您的页眉和页脚就可以根据用户是否通过身份验证而更改,而主要内容区域仍根据您的路线提供内容.

You can use ngInclude to conditionally change the contents of various parts of the page. That way your header and footer can change depending on whether or not the user is authenticated, while the main content area is still serving content based on your routes.

这篇关于多个index.html页面角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆