There are multiple ways to load images and other assets in an Angular project:
<img src="assets/images/logo.png" alt="logo">
ng generate asset myImage.png
This will create a folder calledassetsin your root directory and a folder calledimagesinside that. The image can be placed inside that folder.
.logo {
background-image: url('assets/images/logo.png');
}
These are some of the ways to load images and other assets in an Angular project.
Asked: 2023-07-01 11:58:31 +0000
Seen: 9 times
Last updated: Jul 01 '23