July 2017
Intermediate to advanced
384 pages
8h 23m
English
A collection of images is created programmatically--it is an array of objects with the following three attributes:
Let's create a GalleriaComponent class:
class GalleriaComponent { images: any[]; ngOnInit() { this.images = []; this.images.push({ source: '/assets/data/images/cars/Yeni.png', alt: 'This is a first car', title: 'Yeni Vollkswagen CC' }); this.images.push({ source: '/assets/data/images/cars/Golf.png', alt: 'This is a second car', title: 'Golf' }); ... // more image definitions }}
In the HTML code, the collection is referenced via the input property images:
<p-galleria [images]="images" ...
Read now
Unlock full access