Angular-cli: How can I access images outside of the assets folder

前端 未结 2 1809
情话喂你
情话喂你 2021-01-02 09:29

I\'m very new to Angular and building a photo lightbox as a learning project. Is there a way to use images from outside the project folder? I\'ve tried using the Glob as ref

2条回答
  •  旧时难觅i
    2021-01-02 10:03

    follow below steps :

    my images located in src => images => 1.png it means located in outside the assets folder

    .angular-cli.json

    open angular-cli.json file find the assets array add inside the array your folder name like images.

    "assets": [
      "assets",
      "images",
      "favicon.ico"
    ],
    

    componenet.html

    
    

提交回复
热议问题