简体   繁体   English

如何在视图加载之前加载/导入 css 和资产文件(角度)

[英]How to load/import css and assets files before the view loads (Angular)

I need to load the stylesheet and the files inside the assets folder (icon, images...) before the view loads.在加载视图之前,我需要加载样式表和资产文件夹中的文件(图标、图像...)。

My current problem is that while reloading my app, the images appear after the view by a few milliseconds.我目前的问题是,在重新加载我的应用程序时,图像会在视图之后出现几毫秒。

Is there a way to fix that, with angular?有没有办法用 angular 解决这个问题?

You can do that but with Server Side Rendering because when you load the app (Client side rendering) at that time the javascript find the resources to load您可以使用服务器端渲染来做到这一点,因为当您加载应用程序(客户端渲染)时,javascript 会找到要加载的资源

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

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