1- import { Component , ElementRef , Input , OnInit , viewChild , output } from '@angular/core' ;
1+ import { Component , ElementRef , Input , OnInit , viewChild , output , input } from '@angular/core' ;
22import { CustomEventDetailMap , ModelAttributes , Natural , NaturalGalleryOptions } from '@ecodev/natural-gallery-js' ;
33
44/** @dynamic */
@@ -8,8 +8,8 @@ import {CustomEventDetailMap, ModelAttributes, Natural, NaturalGalleryOptions} f
88 templateUrl : './natural-gallery.component.html' ,
99} )
1010export class NaturalGalleryComponent < T extends ModelAttributes = ModelAttributes > implements OnInit {
11- @ Input ( { required : true } ) public options ! : NaturalGalleryOptions ;
12- @ Input ( ) public scrollable : HTMLElement | undefined | null ;
11+ public readonly options = input . required < NaturalGalleryOptions > ( ) ;
12+ public readonly scrollable = input < HTMLElement | null > ( ) ;
1313
1414 public readonly activate = output < CustomEventDetailMap < T > [ 'activate' ] > ( ) ;
1515 // eslint-disable-next-line @angular-eslint/no-output-native
@@ -40,7 +40,7 @@ export class NaturalGalleryComponent<T extends ModelAttributes = ModelAttributes
4040
4141 public ngOnInit ( ) : void {
4242 setTimeout ( ( ) => {
43- const gallery = new Natural < T > ( this . galleryElement ( ) . nativeElement , this . options , this . scrollable ) ;
43+ const gallery = new Natural < T > ( this . galleryElement ( ) . nativeElement , this . options ( ) , this . scrollable ( ) ) ;
4444
4545 gallery . addEventListener ( 'select' , ev => {
4646 this . select . emit ( ev . detail ) ;
0 commit comments