Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
Angular and lightgallery issue with src attribute

I try to use lightGallery with an Angular 11+ application. The photo gallery works as expected when HTML content is created statically, i.e. data-src attribute of a tag inside lightGallery has static value:

<lightgallery [settings]="settings">
  <a data-lg-size="480-475-480, 800-791-800, 1406-1390" class="gallery-item"
    data-src="image1.jpg" data-responsive="image1-small.jpg" data-sub-html="Photo">
    <img class="img-responsive"
      src="image1-thumbnail.jpg" />
  </a>
</lightgallery>

However, following error message is displayed once data-src is set dynamically:

Can't bind to 'src' since it isn't a known property of 'a'.

Not working part:

<lightgallery [settings]="settings">
  <a *ngFor="let image of images" data-lg-size="480-475-480, 800-791-800, 1406-1390" class="gallery-item"
    data-src="{{image.src}}" data-responsive="{{image.responsive}}" data-sub-html="Photo">
    <img class="img-responsive"
      src="{{image.thumbnail}}" />
  </a>
</lightgallery>

Example is here on stackblitz.

What I do wrong here?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!