Skip to content

Commit

Permalink
feat(Gallery): Allow using custom gallery item with custom template, c…
Browse files Browse the repository at this point in the history
…loses #125
  • Loading branch information
MurhafSousli committed Jul 5, 2018
1 parent f58b790 commit 7e4c302
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions projects/core/src/lib/components/gallery-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ import { GalleryConfig, LoadingStrategy, GalleryItemType } from '../models';
<gallery-iframe *ngSwitchCase="Types.Iframe" [src]="data.src"></gallery-iframe>
<ng-container *ngSwitchDefault>
<div class="g-template g-item-template">
<ng-container *ngTemplateOutlet="config.itemTemplate;
context: { index: this.index, currIndex: this.currIndex, type: this.type, data: this.data }">
</ng-container>
</div>
</ng-container>
</ng-container>
`
})
Expand Down
4 changes: 2 additions & 2 deletions projects/core/src/lib/models/state.model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GalleryAction, GalleryItemType } from './constants';
import { GalleryAction } from './constants';

export interface GalleryState {
action?: GalleryAction;
Expand All @@ -10,5 +10,5 @@ export interface GalleryState {

export interface GalleryItem {
data?: any;
type?: GalleryItemType;
type?: string;
}

0 comments on commit 7e4c302

Please sign in to comment.