简体   繁体   English

如何将 Angular 项目转换为非 Angular 项目?

[英]How to convert an Angular project to a non-Angular project?

I have a current Angular project which I want to be a simple (HTML, CSS, JS) website without the whole script that Angular adds to the project.我有一个当前的 Angular 项目,我想成为一个简单的(HTML、CSS、JS)网站,没有 Angular 添加到项目中的整个脚本。 I want my routes to be converted into several HTML files where each file contains the actual content, not some script tags that refer to some javascript files.我希望将我的路线转换为几个 HTML 文件,其中每个文件都包含实际内容,而不是一些引用某些 javascript 文件的script标签。 I mean I want it to be as if I designed the website without Angular.我的意思是我希望它就像我设计的网站没有 Angular。 I know Angular is effective but I need this for some reason.我知道 Angular 是有效的,但出于某种原因我需要这个。 How can I acheive this?我怎样才能做到这一点?

Fancy way : turn your Angular Components into Web Components by using Angular Elements.花哨的方法:使用 Angular 元素将您的 Angular 组件变成 Web 组件。 Angular Elements is a feature of Angular framework (not a third party package) that allows you to "convert" your Angular components into native Web Components. Angular Elements is a feature of Angular framework (not a third party package) that allows you to "convert" your Angular components into native Web Components. Web Components are custom HTML elements (JS API, not Angular related). Web 组件是自定义 HTML 元素(JS API,与 ZC31C335EF37283C451B18BA0DD317 无关)。 So you can use them in apps built with other frameworks (such as Vue.js) or even in vanilla JS apps.因此,您可以在使用其他框架(例如 Vue.js)构建的应用程序中使用它们,甚至可以在 vanilla JS 应用程序中使用它们。 Web components are now supported natively by any active browser. Web 组件现在受到任何活动浏览器的本地支持。 This is a pretty good guide (in the guide example, we serve an Angular component in a vanilla JS app).这是一个很好的指南(在指南示例中,我们在一个普通的 JS 应用程序中提供了一个 Angular 组件)。

Amanuensis way : manually copy and paste what you need. Amanuensis方式:手动复制粘贴你需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM