Skip to content

Commit f30f899

Browse files
committed
fix(slide): remove carousel token
1 parent 3f8e424 commit f30f899

File tree

3 files changed

+7
-42
lines changed

3 files changed

+7
-42
lines changed

projects/igniteui-angular/src/lib/carousel/carousel-base.ts

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { AnimationReferenceMetadata, useAnimation } from '@angular/animations';
2-
import { ChangeDetectorRef, EventEmitter, Inject, InjectionToken } from '@angular/core';
2+
import { ChangeDetectorRef, EventEmitter, Inject } from '@angular/core';
33
import { IgxAngularAnimationService } from '../services/animation/angular-animation-service';
44
import { AnimationPlayer, AnimationService } from '../services/animation/animation';
55
import { fadeIn, slideInLeft } from 'igniteui-angular/animations';
6-
import { CarouselAnimationType, CarouselIndicatorsOrientation } from './enums';
6+
import { CarouselAnimationType } from './enums';
77

88
export enum Direction { NONE, NEXT, PREV }
99

@@ -12,37 +12,6 @@ export interface CarouselAnimationSettings {
1212
leaveAnimation: AnimationReferenceMetadata;
1313
}
1414

15-
export interface ICarouselComponentBase {
16-
id: string;
17-
role: string;
18-
cssClass: string;
19-
loop: boolean;
20-
pause: boolean;
21-
navigation: boolean;
22-
indicators: boolean;
23-
vertical: boolean;
24-
keyboardSupport: boolean;
25-
gesturesSupport: boolean;
26-
maximumIndicatorsCount: number;
27-
indicatorsOrientation: CarouselIndicatorsOrientation;
28-
animationType: CarouselAnimationType;
29-
total: number;
30-
current: number;
31-
interval: number;
32-
slideChanged: EventEmitter<any>;
33-
slideAdded: EventEmitter<any>;
34-
slideRemoved: EventEmitter<any>;
35-
carouselPaused: EventEmitter<any>;
36-
carouselPlaying: EventEmitter<any>;
37-
next(): void;
38-
prev(): void;
39-
play(): void;
40-
stop(): void
41-
}
42-
43-
/** @hidden */
44-
export const IGX_CAROUSEL_COMPONENT = /*@__PURE__*/new InjectionToken<ICarouselComponentBase>('IgxCarouselToken');
45-
4615
/** @hidden */
4716
export interface IgxSlideComponentBase {
4817
direction: Direction;

projects/igniteui-angular/src/lib/carousel/carousel.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { CarouselResourceStringsEN, ICarouselResourceStrings } from '../core/i18
3030
import { first, IBaseEventArgs, last, PlatformUtil } from '../core/utils';
3131
import { IgxAngularAnimationService } from '../services/animation/angular-animation-service';
3232
import { AnimationService } from '../services/animation/animation';
33-
import { Direction, ICarouselComponentBase, IGX_CAROUSEL_COMPONENT, IgxCarouselComponentBase } from './carousel-base';
33+
import { Direction, IgxCarouselComponentBase } from './carousel-base';
3434
import { IgxCarouselIndicatorDirective, IgxCarouselNextButtonDirective, IgxCarouselPrevButtonDirective } from './carousel.directives';
3535
import { IgxSlideComponent } from './slide.component';
3636
import { IgxIconComponent } from '../icon/icon.component';
@@ -75,8 +75,7 @@ export class CarouselHammerConfig extends HammerGestureConfig {
7575
{
7676
provide: HAMMER_GESTURE_CONFIG,
7777
useClass: CarouselHammerConfig
78-
},
79-
{ provide: IGX_CAROUSEL_COMPONENT, useExisting: IgxCarouselComponent }
78+
}
8079
],
8180
selector: 'igx-carousel',
8281
templateUrl: 'carousel.component.html',
@@ -88,7 +87,7 @@ export class CarouselHammerConfig extends HammerGestureConfig {
8887
imports: [IgxButtonDirective, IgxIconComponent, NgIf, NgClass, NgFor, NgTemplateOutlet]
8988
})
9089

91-
export class IgxCarouselComponent extends IgxCarouselComponentBase implements ICarouselComponentBase, OnDestroy, AfterContentInit {
90+
export class IgxCarouselComponent extends IgxCarouselComponentBase implements OnDestroy, AfterContentInit {
9291

9392
/**
9493
* Sets the `id` of the carousel.

projects/igniteui-angular/src/lib/carousel/slide.component.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnDestroy, Input, HostBinding, Output, EventEmitter, ElementRef, AfterContentChecked, booleanAttribute, Inject } from '@angular/core';
22
import { Subject } from 'rxjs';
3-
import { Direction, ICarouselComponentBase, IGX_CAROUSEL_COMPONENT, IgxSlideComponentBase } from './carousel-base';
3+
import { Direction, IgxSlideComponentBase } from './carousel-base';
44

55
/**
66
* A slide component that usually holds an image and/or a caption text.
@@ -130,10 +130,7 @@ export class IgxSlideComponent implements AfterContentChecked, OnDestroy, IgxSli
130130
private _active = false;
131131
private _destroy$ = new Subject<boolean>();
132132

133-
constructor(
134-
private elementRef: ElementRef,
135-
@Inject(IGX_CAROUSEL_COMPONENT) private carousel: ICarouselComponentBase
136-
) { }
133+
constructor(private elementRef: ElementRef) { }
137134

138135
/**
139136
* Returns a reference to the carousel element in the DOM.

0 commit comments

Comments
 (0)