Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

data-src attribute on image tag replaces src automatically #13126

@dinbror

Description

@dinbror

When you both have a data-src and src attribute on an image angular somehow tries to resolve it but it doesn't work consistently across browsers!

Can someone please elaborate:

  • <img data-ng-src="{{imgsrc}}"> adds a src on the image tag (expected)
  • <img data-src="{{imgsrc}}"> doesn't do anything (expected).
  • <img data-src="{{imgsrc}}" src="base64 encoded placeholder"> replaces src with data-src attribute in webkit browsers (chrome, safari), not in firefox or IE (didn't expect it to do anything).
  • <img src="base64 encoded placeholder" data-src="{{imgsrc}}"> replaces src with data-src attribute in firefox, not in webkit browsers or IE (didn't expect it to do anything).

See @tsamu jsfiddle for reference: http://jsfiddle.net/ryo2vg88/5/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions