Angular 4 img src is not found

后端 未结 16 1561
我寻月下人不归
我寻月下人不归 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:54

    Add in angular.json

      "assets": [
                  "src/favicon.ico",
                  "src/assets"
                ],
    

    And then use it like this: img

    And in ts: storyPath = 'assets/images/myImg.png';

提交回复
热议问题