Skip to content

Commit ebe63bb

Browse files
committed
Automatic migration to signals #11431
1 parent 85a9bf3 commit ebe63bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

projects/angular-natural-gallery/src/lib/natural-gallery/natural-gallery.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, ElementRef, Input, OnInit, viewChild, output} from '@angular/core';
1+
import {Component, ElementRef, Input, OnInit, viewChild, output, input} from '@angular/core';
22
import {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
})
1010
export 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

Comments
 (0)