最佳实践?在哪里存储图像成角度? [英] best practice? where to store an image in angular?

查看:41
本文介绍了最佳实践?在哪里存储图像成角度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在学习有角度的知识,因为我将开始使用它来进行大量的项目工作.无论如何,我只是在玩一些东西,而在找出存储图像文件的最佳位置时遇到了一些麻烦.我已经成功使用index.html文件和style.css设置了背景图片.但是现在我正在尝试在组件级别使用一些图片,并且遇到了一些困难.任何建议将不胜感激.

I'm currently learning angular as I'm about to start a boat load of projects at work using it. Anyways, I'm just playing around with some stuff and I'm having some trouble figuring out the best place to store an image file. I've had success with the index.html file and the style.css setting a background image. But now I'm trying to use some pictures on the component level and just having some difficulty. Any advice would be greatly appreciated.

推荐答案

如果您的应用程序中需要太多图像,则将图像上载到某个服务器,那里有很多图像服务器.但是,如果您的图像很少,则可以将其存储在

If you want too many images in your application then upload your images to some server there lots of image servers out there. But if you have few images then you can store in

src/assets/images

文件夹.通过在图像URL中设置路径直接访问它们.

folder. Access them directly by setting the path in image URL.

这篇关于最佳实践?在哪里存储图像成角度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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