How to prevent ng-src to load image before data arrives?

后端 未结 4 529
暖寄归人
暖寄归人 2021-01-31 09:04

HTML:

 \"{{album.title}}\"

While running the app, it

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-31 09:44

    Try to use the conditional pattern condition && true || false

    Therefore modify ng-src attribute like this:

    {{album.title}}
    

    With this change, the content of src attribute is empty until the data arrives.

    Source: Conditionally change img src based on model data

提交回复
热议问题