import { Component, Input } from '@angular/core' import { BsModalRef, BsModalService } from 'ngx-bootstrap' import { GalleryModalComponent } from '../gallery-modal/gallery-modal.component' @Component({ selector: 'app-gallery-item', template: `
Photo by {{ user.name }} {{ user.surname }}
{{ user.name }} {{ user.surname }}
{{ index | random: 3: 20 | round }} days ago
`, styles: [], }) export class GalleryItemComponent { @Input() public user @Input() public photo @Input() public index public modalRef: BsModalRef constructor(private modalService: BsModalService) {} public open(photo, user, index) { const initialState = { photo, user, index, } this.modalRef = this.modalService.show(GalleryModalComponent, { initialState, class: 'modal-lg', }) this.modalRef.content.closeBtnName = 'Close' } }