How to load image (and other assets) in Angular an project?

前端 未结 8 1065
猫巷女王i
猫巷女王i 2020-11-29 03:14

I\'m pretty new to Angular so I\'m not sure the best practice to do this.

I used angular-cli and ng new some-project to generate a new app.

In

8条回答
  •  孤城傲影
    2020-11-29 03:54

    In my project I am using the following syntax in my app.component.html:

    image
    

    or

    image
    

    use [src] as a template expression when you are binding a property using interpolation:

    
    

    is the same as:

    
    

    Source: how to bind img src in angular 2 in ngFor?

提交回复
热议问题