Angular 4 img src is not found

后端 未结 16 1542
我寻月下人不归
我寻月下人不归 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-24 10:47

    @Annk you can make a variable in the __component.ts file

    myImage : string = "http://example.com/path/image.png";

    and inside the __.component.html file you can use one of those 3 methods :

    1 .

    2 .

    3 .

提交回复
热议问题