在Angular4外部提供静态HTML [英] Serving static html outside Angular4

查看:285
本文介绍了在Angular4外部提供静态HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Angular 4/Angular 2的初学者.我正在构建一个包含

I am a beginner in Angular 4/ Angular 2. I am building an app which consists of

1)静态html文件(aboutus.html,price.html,contact us.html等),以及相应的CSS,JS文件 2)具有复杂功能的单页应用程序

1) static html files( aboutus.html, pricing.html, contact us.html etc), with corresponding css, js files 2) single page application with complex functionality

第一部分#1完全不需要Angular,因为它是完全静态的.登录后,用户进入第二名.从我所经历的Angular教程中,看来我需要将#1和#2组合在一起,但仍然必须从#1中创建组件等,这是不必要的.

The first part #1 does not need Angular at all as it's completely static. After login a user comes to #2. From the Angular tutorials that I went through, it seems I need to combine #1 and #2 together and still have to create components etc out of #1, which I feel is unnecessary.

有没有办法,我可以构建该项目,以便可以按原样使用静态html并将Angular仅用于动态单页应用程序?任何有用的链接或示例将不胜感激.

Is there a way, I can build this project such that I can use the static html as is and use Angular only for the dynamic single page app? Any helpful links or examples would be much appreciated.

推荐答案

您不能使用路由器来集成静态html页面,但仍可以使用普通的HTML链接. 无需命名包含Angular应用程序index.html

You can't use the router to integrate static html pages, but you still can use normal HTML links. There is no need to name the file that contains the Angular application index.html

这篇关于在Angular4外部提供静态HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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