Angular 4 img src is not found

后端 未结 16 1571
我寻月下人不归
我寻月下人不归 2020-12-24 10:11

I\'m having a problem with sourcing an image with angular 4. It keeps telling me that the image is not found.

Folder structure:

app_folder/
app_compo         


        
16条回答
  •  孤独总比滥情好
    2020-12-24 10:47

    in your component assign a variable like,

    export class AppComponent {
      netImage:any = "../assets/network.jpg";
      title = 'app';
    }
    

    use this netImage in your src to get the image, as given below,

    A generic square placeholder image with rounded corners in a figure.
    A caption for the above image.

提交回复
热议问题