File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
projects/angular-natural-gallery/src/lib/natural-gallery Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ export class NaturalGalleryComponent<T extends ModelAttributes = ModelAttributes
1515 // eslint-disable-next-line @angular-eslint/no-output-native
1616 public readonly select = output < CustomEventDetailMap < T > [ 'select' ] > ( ) ;
1717 public readonly pagination = output < CustomEventDetailMap < T > [ 'pagination' ] > ( ) ;
18+ public readonly itemAddedToDom = output < CustomEventDetailMap < T > [ 'item-added-to-dom' ] > ( ) ;
19+ public readonly itemDisplayed = output < CustomEventDetailMap < T > [ 'item-displayed' ] > ( ) ;
1820
1921 private readonly galleryElement = viewChild . required < ElementRef < HTMLElement > > ( 'gallery' ) ;
2022
@@ -52,6 +54,14 @@ export class NaturalGalleryComponent<T extends ModelAttributes = ModelAttributes
5254 this . pagination . emit ( ev . detail ) ;
5355 } ) ;
5456
57+ gallery . addEventListener ( 'item-added-to-dom' , ev => {
58+ this . itemAddedToDom . emit ( ev . detail ) ;
59+ } ) ;
60+
61+ gallery . addEventListener ( 'item-displayed' , ev => {
62+ this . itemDisplayed . emit ( ev . detail ) ;
63+ } ) ;
64+
5565 if ( this . _items . length ) {
5666 gallery . setItems ( this . _items ) ;
5767 }
Original file line number Diff line number Diff line change 1010 (pagination) ="log('pagination', $event) "
1111 (activate) ="log('activate', $event) "
1212 (select) ="log('select', $event) "
13+ (itemAddedToDom) ="log('item-added-to-dom', $event) "
1314/>
You can’t perform that action at this time.
0 commit comments