简体   繁体   English

将 js、html 和 css 文件包含到 angular 项目中

[英]Include js, html and css files to an angular project

I have a javascript project.我有一个 javascript 项目。 I want to run those within an angular project.我想在一个角度项目中运行它们。

Can I integrate js project to an angular project?我可以将 js 项目集成到 angular 项目中吗?

Can I get those js files to assets folder?我可以将这些 js 文件放到资产文件夹中吗? If yes, where do we integrate those HTML and CSS files?如果是,我们在哪里集成这些 HTML 和 CSS 文件?

Please help me on this请帮我解决这个问题

app/
----- controllers/
---------- mainController.js
---------- otherController.js
----- directives/
---------- mainDirective.js
---------- otherDirective.js
----- services/
---------- userService.js
---------- itemService.js
----- js/
---------- bootstrap.js
---------- jquery.js
----- app.js
views/
----- mainView.html
----- otherView.html
----- index.html

you can import the css or html file into the index.html file like so:您可以将 css 或 html 文件导入到 index.html 文件中,如下所示:

import "~/filename.css"

you can also include the css or javascript file, by including the pathtofile inside the angular.json file您还可以通过在 angular.json 文件中包含 pathtofile 来包含 css 或 javascript 文件

"style:"pathtocss", "script":"pathtojs"

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

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