Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

html - 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. 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. I mean I want it to be as if I designed the website without Angular. I know Angular is effective but I need this for some reason. How can I acheive this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Fancy way: turn your Angular Components into Web Components by using Angular Elements. 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). So you can use them in apps built with other frameworks (such as Vue.js) or even in vanilla JS apps. Web components are now supported natively by any active browser. This is a pretty good guide (in the guide example, we serve an Angular component in a vanilla JS app).

Amanuensis way: manually copy and paste what you need.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...