Skip to content

Commit ca7c47b

Browse files
committed
feat: remove the Event service provider and the animation service
provider and just provide them in root
1 parent de227e4 commit ca7c47b

13 files changed

+20
-53
lines changed

src/breadcrumb/breadcrumb.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { I18n } from "carbon-components-angular/i18n";
1818
import { NgClass, NgTemplateOutlet } from "@angular/common";
1919
import { IconDirective } from "carbon-components-angular/icon";
2020
import { OverflowMenu } from "carbon-components-angular/dialog";
21-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
21+
import { EventService } from "carbon-components-angular/utils";
2222

2323
const MINIMUM_OVERFLOW_THRESHOLD = 4;
2424

@@ -129,7 +129,7 @@ const MINIMUM_OVERFLOW_THRESHOLD = 4;
129129
`,
130130
changeDetection: ChangeDetectionStrategy.OnPush,
131131
standalone: true,
132-
providers: [EventService, DOCUMENT_SERVICE_PROVIDER],
132+
providers: [EventService],
133133
imports: [NgClass, BreadcrumbItemComponent, NgTemplateOutlet, IconDirective, OverflowMenu]
134134
})
135135
export class Breadcrumb implements AfterContentInit {

src/code-snippet/code-snippet.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010

1111
import { BaseIconButton } from "carbon-components-angular/button";
1212
import { I18n } from "carbon-components-angular/i18n";
13-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
13+
import { EventService } from "carbon-components-angular/utils";
1414
import { NgTemplateOutlet, NgClass, NgStyle } from "@angular/common";
1515
import { IconDirective } from "carbon-components-angular/icon";
1616
import { IconButton } from "carbon-components-angular/button";
@@ -141,7 +141,7 @@ export enum SnippetType {
141141
`,
142142
changeDetection: ChangeDetectionStrategy.OnPush,
143143
standalone: true,
144-
providers: [EventService, DOCUMENT_SERVICE_PROVIDER],
144+
providers: [EventService],
145145
imports: [NgTemplateOutlet, NgClass, NgStyle, IconDirective, IconButton]
146146
})
147147
export class CodeSnippet extends BaseIconButton implements OnInit, AfterViewInit {

src/dialog/dialog.directive.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "@angular/core";
1616
import { DialogService } from "./dialog.service";
1717
import { CloseMeta, CloseReasons, DialogConfig } from "./dialog-config.interface";
18-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
18+
import { EventService } from "carbon-components-angular/utils";
1919
import { Dialog } from "./dialog.component";
2020
import { fromEvent, Subscription } from "rxjs";
2121

@@ -33,8 +33,7 @@ import { fromEvent, Subscription } from "rxjs";
3333
exportAs: "dialog",
3434
providers: [
3535
DialogService,
36-
EventService,
37-
DOCUMENT_SERVICE_PROVIDER
36+
EventService
3837
],
3938
standalone: true
4039
})

src/dialog/overflow-menu/overflow-menu.directive.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { DialogDirective } from "../dialog.directive";
1010
import { DialogService } from "../dialog.service";
1111
import { OverflowMenuPane } from "./overflow-menu-pane.component";
1212
import { OverflowMenuCustomPane } from "./overflow-menu-custom-pane.component";
13-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
13+
import { EventService } from "carbon-components-angular/utils";
1414
import { PlaceholderService } from "carbon-components-angular/placeholder";
1515

1616

@@ -43,7 +43,6 @@ import { PlaceholderService } from "carbon-components-angular/placeholder";
4343
providers: [
4444
DialogService,
4545
EventService,
46-
DOCUMENT_SERVICE_PROVIDER,
4746
PlaceholderService
4847
],
4948
standalone: true

src/dropdown/dropdown.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { DropdownService } from "./dropdown.service";
3131
import {
3232
AnimationFrameService,
3333
AnimationFrameServiceSingleton,
34-
DOCUMENT_SERVICE_PROVIDER,
34+
3535
ElementService,
3636
EventService,
3737
getScrollableParents
@@ -225,8 +225,7 @@ import { PlaceholderService } from "carbon-components-angular/placeholder";
225225
AnimationFrameServiceSingleton,
226226
DropdownService,
227227
ElementService,
228-
EventService,
229-
DOCUMENT_SERVICE_PROVIDER
228+
EventService
230229
],
231230
changeDetection: ChangeDetectionStrategy.OnPush,
232231
standalone: true,

src/slider/slider.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
ChangeDetectorRef
1414
} from "@angular/core";
1515
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
16-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
16+
import { EventService } from "carbon-components-angular/utils";
1717
import { NgClass, NgTemplateOutlet, NgStyle } from "@angular/common";
1818

1919
/**
@@ -158,7 +158,7 @@ import { NgClass, NgTemplateOutlet, NgStyle } from "@angular/common";
158158
useExisting: Slider,
159159
multi: true
160160
},
161-
DOCUMENT_SERVICE_PROVIDER,
161+
162162
EventService
163163
],
164164
standalone: true,

src/tabs/base-tab-header.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
HostBinding,
99
Renderer2
1010
} from "@angular/core";
11-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
11+
import { EventService } from "carbon-components-angular/utils";
1212

1313
/**
1414
* There are two ways to create a tab, this class is a collection of features
@@ -17,7 +17,7 @@ import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angul
1717
@Component({
1818
template: "",
1919
standalone: true,
20-
providers: [EventService, DOCUMENT_SERVICE_PROVIDER]
20+
providers: [EventService]
2121
})
2222
export class BaseTabHeader {
2323
/**

src/tabs/tab-header-group.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "@angular/core";
1616

1717
import { Subscription } from "rxjs";
18-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
18+
import { EventService } from "carbon-components-angular/utils";
1919

2020
import { TabHeader } from "./tab-header.directive";
2121
import { BaseTabHeader } from "./base-tab-header.component";
@@ -84,7 +84,7 @@ import { NgClass, NgTemplateOutlet } from "@angular/common";
8484
</button>
8585
`,
8686
standalone: true,
87-
providers: [DOCUMENT_SERVICE_PROVIDER, EventService],
87+
providers: [EventService],
8888
imports: [NgClass, NgTemplateOutlet]
8989
})
9090
export class TabHeaderGroup extends BaseTabHeader implements AfterContentInit, OnChanges, OnInit {

src/tabs/tab-headers.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
Renderer2,
1717
EventEmitter
1818
} from "@angular/core";
19-
import { DOCUMENT_SERVICE_PROVIDER, EventService } from "carbon-components-angular/utils";
19+
import { EventService } from "carbon-components-angular/utils";
2020
import { I18n } from "carbon-components-angular/i18n";
2121

2222
import { BaseTabHeader } from "./base-tab-header.component";
@@ -114,7 +114,7 @@ import { NgClass, NgTemplateOutlet } from "@angular/common";
114114
</button>
115115
`,
116116
standalone: true,
117-
providers: [EventService, DOCUMENT_SERVICE_PROVIDER],
117+
providers: [EventService],
118118
imports: [NgClass, NgTemplateOutlet]
119119
})
120120

src/utils/animation-frame.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from "@angular/core";
66
import { Observable, Subject, from } from "rxjs";
77

8-
@Injectable()
8+
@Injectable({providedIn: "root"})
99
export class AnimationFrameServiceSingleton implements OnDestroy {
1010
public tick: Observable<number>;
1111

0 commit comments

Comments
 (0)