Custom attributes
To add a custom attribute, such as "alt", to a source, use the "customAttributes" array prop:
<fslightbox
[sources]="['/Images/1.jpg', '/Images/2.jpg']"
[customAttributes]="[
{
alt: 'A first example description.'
},
{
alt: 'A second example description.'
}
]"
/>Any attribute can be added:
<fslightbox
[sources]="['/Image.jpg']"
[customAttributes]="[
{
alt: 'An example description.',
srcset: '/Image.jpg 600w, /Images/2.jpg 1200w',
foo: 'bar'
}
]"
/>
<!-- The rendered source -->
<img
src="/Image.jpg"
alt="An example description."
srcset="/Image.jpg 600w, /Images/2.jpg 1200w"
foo="bar"
>