Skip to content

Commit 07e49e2

Browse files
fix(ngx-custom-carousel.ts, demo.component.html): fixed issue to disable and enable auto carousel
Fixed issue related to enable and disable auto carousel
1 parent 2105336 commit 07e49e2

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

projects/ngx-custom-carousel/src/lib/components/ngx-custom-carousel/ngx-custom-carousel.component.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ export class NgxCustomCarouselComponent
3939
}
4040

4141
ngOnChanges(changes: SimpleChanges): void {
42-
if (changes['enableControls']) {
43-
this.isControlEnabled = changes['enableControls'].currentValue;
44-
if (this.isControlEnabled) {
42+
if (changes['enableAutoSwitch']) {
43+
if (changes['enableAutoSwitch'].currentValue) {
4544
this.startInterval();
4645
} else {
4746
this.stopInterval();

src/app/components/demo/demo.component.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
type="number"
2323
matInput
2424
[formControl]="delay"
25-
placeholder="Delay in ms" />
25+
placeholder="Delay in ms"
26+
[min]="100" />
2627
@if (
2728
delay.hasError('positiveInteger') &&
2829
!delay.hasError('required')
@@ -34,6 +35,16 @@
3435
>Delay is <strong>required</strong></mat-error
3536
>
3637
}
38+
@if (
39+
!delay.hasError('positiveInteger') &&
40+
!delay.hasError('required') &&
41+
delay.hasError('min')
42+
) {
43+
<mat-error
44+
>Minimum value should be
45+
<strong>100</strong></mat-error
46+
>
47+
}
3748
</mat-form-field>
3849
</form>
3950
</div>

0 commit comments

Comments
 (0)