Skip to content

Commit 4a3ca82

Browse files
rafaelss95mmalerba
andauthored
refactor: make all event emitters readonly (#17666)
* refactor(material/core): make all event emitters readonly * fixup! refactor(material/core): make all event emitters readonly Co-authored-by: Miles Malerba <[email protected]>
1 parent 7b7c1cf commit 4a3ca82

File tree

124 files changed

+531
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+531
-587
lines changed

guides/bidirectionality.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class MyCustomComponent {
3131
this.dir = directionality.value;
3232

3333
directionality.change.subscribe(() => {
34-
this.dir = directionality.value;
34+
this.dir = directionality.value;
3535
});
3636
}
3737
}

src/cdk-experimental/dialog/dialog-container.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,19 @@ export class CdkDialogContainer extends BasePortalOutlet implements OnDestroy {
104104
@ViewChild(CdkPortalOutlet, {static: true}) _portalHost: CdkPortalOutlet;
105105

106106
/** A subject emitting before the dialog enters the view. */
107-
_beforeEnter: Subject<void> = new Subject();
107+
readonly _beforeEnter = new Subject<void>();
108108

109109
/** A subject emitting after the dialog enters the view. */
110-
_afterEnter: Subject<void> = new Subject();
110+
readonly _afterEnter = new Subject<void>();
111111

112112
/** A subject emitting before the dialog exits the view. */
113-
_beforeExit: Subject<void> = new Subject();
113+
readonly _beforeExit = new Subject<void>();
114114

115115
/** A subject emitting after the dialog exits the view. */
116-
_afterExit: Subject<void> = new Subject();
116+
readonly _afterExit = new Subject<void>();
117117

118118
/** Stream of animation `done` events. */
119-
_animationDone = new Subject<AnimationEvent>();
119+
readonly _animationDone = new Subject<AnimationEvent>();
120120

121121
constructor(
122122
private _elementRef: ElementRef<HTMLElement>,

src/cdk-experimental/dialog/dialog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Dialog implements OnDestroy {
5454
_getAfterAllClosed(): Observable<void> {
5555
return this._parentDialog ? this._parentDialog.afterAllClosed : this._afterAllClosedBase;
5656
}
57-
_afterAllClosedBase = new Subject<void>();
57+
readonly _afterAllClosedBase = new Subject<void>();
5858

5959
// TODO(jelbourn): tighten the type on the right-hand side of this expression.
6060
afterAllClosed: Observable<void> = defer(() => this.openDialogs.length ?
@@ -64,7 +64,7 @@ export class Dialog implements OnDestroy {
6464
get afterOpened(): Subject<DialogRef<any>> {
6565
return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpened;
6666
}
67-
_afterOpened: Subject<DialogRef<any>> = new Subject();
67+
readonly _afterOpened = new Subject<DialogRef<any>>();
6868

6969
/** Stream that emits when a dialog is opened. */
7070
get openDialogs(): DialogRef<any>[] {

src/cdk-experimental/listbox/listbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class CdkOption<T = unknown> implements ListKeyManagerOption, Highlightab
9393
this._value = value;
9494
}
9595

96-
@Output() readonly selectionChange: EventEmitter<OptionSelectionChangeEvent<T>> =
96+
@Output() readonly selectionChange =
9797
new EventEmitter<OptionSelectionChangeEvent<T>>();
9898

9999
constructor(private readonly _elementRef: ElementRef,
@@ -243,7 +243,7 @@ export class CdkListbox<T> implements AfterContentInit, OnDestroy, OnInit, Contr
243243

244244
@ContentChildren(CdkOption, {descendants: true}) _options: QueryList<CdkOption<T>>;
245245

246-
@Output() readonly selectionChange: EventEmitter<ListboxSelectionChangeEvent<T>> =
246+
@Output() readonly selectionChange =
247247
new EventEmitter<ListboxSelectionChangeEvent<T>>();
248248

249249
@Input() id = `cdk-listbox-${listboxId++}`;

src/cdk-experimental/menu/context-menu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class CdkContextMenuTrigger implements OnDestroy {
129129
private _panelContent: TemplatePortal;
130130

131131
/** Emits when the element is destroyed. */
132-
private readonly _destroyed: Subject<void> = new Subject();
132+
private readonly _destroyed = new Subject<void>();
133133

134134
/** The menu stack for this trigger and its associated menus. */
135135
private readonly _menuStack = new MenuStack();

src/cdk-experimental/menu/menu-item-selectable.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ let nextId = 0;
2020
@Directive()
2121
export abstract class CdkMenuItemSelectable extends CdkMenuItem {
2222
/** Event emitted when the selectable item is clicked */
23-
@Output('cdkMenuItemToggled') toggled: EventEmitter<CdkMenuItemSelectable> = new EventEmitter();
23+
@Output('cdkMenuItemToggled') readonly toggled: EventEmitter<CdkMenuItemSelectable> =
24+
new EventEmitter();
2425

2526
/** Whether the element is checked */
2627
@Input()

src/cdk-experimental/menu/menu-item.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class CdkMenuItem implements FocusableOption, FocusableElement, Toggler,
7070
* If this MenuItem is a regular MenuItem, outputs when it is triggered by a keyboard or mouse
7171
* event.
7272
*/
73-
@Output('cdkMenuItemTriggered') triggered: EventEmitter<void> = new EventEmitter();
73+
@Output('cdkMenuItemTriggered') readonly triggered: EventEmitter<void> = new EventEmitter();
7474

7575
/**
7676
* The tabindex for this menu item managed internally and used for implementing roving a
@@ -79,7 +79,7 @@ export class CdkMenuItem implements FocusableOption, FocusableElement, Toggler,
7979
_tabindex: 0 | -1 = -1;
8080

8181
/** Emits when the menu item is destroyed. */
82-
private readonly _destroyed: Subject<void> = new Subject();
82+
private readonly _destroyed = new Subject<void>();
8383

8484
constructor(
8585
readonly _elementRef: ElementRef<HTMLElement>,

src/cdk-experimental/popover-edit/focus-escape-notifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const enum FocusEscapeNotifierDirection {
2222
* focus leaves the region.
2323
*/
2424
export class FocusEscapeNotifier extends FocusTrap {
25-
private _escapeSubject = new Subject<FocusEscapeNotifierDirection>();
25+
private readonly _escapeSubject = new Subject<FocusEscapeNotifierDirection>();
2626

2727
constructor(
2828
element: HTMLElement,

src/cdk-experimental/popover-edit/lens-directives.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class CdkEditControl<FormValue> implements OnDestroy, OnInit {
8484
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
8585
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
8686
// can move this back into `host`.
87-
// tslint:disable:no-host-decorator-in-concrete
87+
// tslint:disable-next-line:no-host-decorator-in-concrete
8888
@HostListener('ngSubmit')
8989
handleFormSubmit(): void {
9090
if (this.ignoreSubmitUnlessValid && !this.editRef.isValid()) { return; }
@@ -107,7 +107,7 @@ export class CdkEditControl<FormValue> implements OnDestroy, OnInit {
107107
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
108108
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
109109
// can move this back into `host`.
110-
// tslint:disable:no-host-decorator-in-concrete
110+
// tslint:disable-next-line:no-host-decorator-in-concrete
111111
@HostListener('document:click', ['$event'])
112112
handlePossibleClickOut(evt: Event): void {
113113
if (closest(evt.target, EDIT_PANE_SELECTOR)) { return; }
@@ -128,7 +128,7 @@ export class CdkEditControl<FormValue> implements OnDestroy, OnInit {
128128
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
129129
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
130130
// can move this back into `host`.
131-
// tslint:disable:no-host-decorator-in-concrete
131+
// tslint:disable-next-line:no-host-decorator-in-concrete
132132
@HostListener('keydown', ['$event'])
133133
_handleKeydown(event: KeyboardEvent) {
134134
if (event.key === 'Escape' && !hasModifierKey(event)) {
@@ -167,7 +167,7 @@ export class CdkEditRevert<FormValue> {
167167
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
168168
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
169169
// can move this back into `host`.
170-
// tslint:disable:no-host-decorator-in-concrete
170+
// tslint:disable-next-line:no-host-decorator-in-concrete
171171
@HostListener('click')
172172
revertEdit(): void {
173173
this.editRef.reset();
@@ -192,10 +192,8 @@ export class CdkEditClose<FormValue> {
192192
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
193193
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
194194
// can move this back into `host`.
195-
// tslint:disable:no-host-decorator-in-concrete
196-
@HostListener('click')
197-
@HostListener('keydown.enter')
198-
@HostListener('keydown.space')
195+
// tslint:disable-next-line:no-host-decorator-in-concrete
196+
@HostListener('click') @HostListener('keydown.enter') @HostListener('keydown.space')
199197
closeEdit(): void {
200198
// Note that we use `click` here, rather than a keyboard event, because some screen readers
201199
// will emit a fake click event instead of an enter keyboard event on buttons. For the keyboard

src/cdk-experimental/popover-edit/table-directives.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ export class CdkEditOpen {
501501
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
502502
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
503503
// can move this back into `host`.
504-
// tslint:disable:no-host-decorator-in-concrete
504+
// tslint:disable-next-line:no-host-decorator-in-concrete
505505
@HostListener('click', ['$event'])
506506
openEdit(evt: Event): void {
507507
this.editEventDispatcher.editing.next(closest(this.elementRef.nativeElement!, CELL_SELECTOR));

src/cdk-experimental/selection/selection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class CdkSelection<T> implements OnInit, AfterContentChecked, CollectionV
6060
protected _multiple: boolean;
6161

6262
/** Emits when selection changes. */
63-
@Output('cdkSelectionChange') change = new EventEmitter<SelectionChange<T>>();
63+
@Output('cdkSelectionChange') readonly change = new EventEmitter<SelectionChange<T>>();
6464

6565
/** Latest data provided by the data source. */
6666
private _data: T[]|readonly T[];

src/cdk/a11y/focus-monitor/focus-monitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const FOCUS_MONITOR_DEFAULT_OPTIONS =
7171

7272
type MonitoredElementInfo = {
7373
checkChildren: boolean,
74-
subject: Subject<FocusOrigin>,
74+
readonly subject: Subject<FocusOrigin>,
7575
rootNode: HTMLElement|ShadowRoot|Document
7676
};
7777

@@ -604,7 +604,7 @@ function getTarget(event: Event): HTMLElement|null {
604604
})
605605
export class CdkMonitorFocus implements AfterViewInit, OnDestroy {
606606
private _monitorSubscription: Subscription;
607-
@Output() cdkFocusChange = new EventEmitter<FocusOrigin>();
607+
@Output() readonly cdkFocusChange = new EventEmitter<FocusOrigin>();
608608

609609
constructor(private _elementRef: ElementRef<HTMLElement>, private _focusMonitor: FocusMonitor) {}
610610

src/cdk/a11y/key-manager/list-key-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class ListKeyManager<T extends ListKeyManagerOption> {
4444
private _activeItemIndex = -1;
4545
private _activeItem: T | null = null;
4646
private _wrap = false;
47-
private _letterKeyStream = new Subject<string>();
47+
private readonly _letterKeyStream = new Subject<string>();
4848
private _typeaheadSubscription = Subscription.EMPTY;
4949
private _vertical = true;
5050
private _horizontal: 'ltr' | 'rtl' | null;
@@ -82,10 +82,10 @@ export class ListKeyManager<T extends ListKeyManagerOption> {
8282
* Stream that emits any time the TAB key is pressed, so components can react
8383
* when focus is shifted off of the list.
8484
*/
85-
tabOut: Subject<void> = new Subject<void>();
85+
readonly tabOut = new Subject<void>();
8686

8787
/** Stream that emits whenever the active item of the list manager changes. */
88-
change = new Subject<number>();
88+
readonly change = new Subject<number>();
8989

9090
/**
9191
* Sets the predicate function that determines which items should be skipped by the
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
### LiveAnnouncer
22
`LiveAnnouncer` is used to announce messages for screen-reader users using an `aria-live` region.
33
See [the W3C's WAI-ARIA](https://www.w3.org/TR/wai-aria/states_and_properties#aria-live)
4-
for more information on aria-live regions.
4+
for more information on aria-live regions.
55

66
#### Methods
77

88
##### `announce(message: string, politeness?: 'off' | 'polite' | 'assertive'): void`
9-
Announce the given message via aria-live region. The politeness argument determines the
9+
Announce the given message via aria-live region. The politeness argument determines the
1010
`aria-live` attribute on the announcer element, defaulting to 'polite'.
1111

1212
#### Examples
@@ -18,9 +18,8 @@ The LiveAnnouncer is injected into a component:
1818
})
1919
export class MyComponent {
2020

21-
constructor(liveAnnouncer: LiveAnnouncer) {
22-
liveAnnouncer.announce("Hey Google");
23-
}
24-
21+
constructor(liveAnnouncer: LiveAnnouncer) {
22+
liveAnnouncer.announce("Hey Google");
23+
}
2524
}
2625
```

src/cdk/accordion/accordion-item.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ export class CdkAccordionItem implements OnDestroy {
4242
/** Subscription to openAll/closeAll events. */
4343
private _openCloseAllSubscription = Subscription.EMPTY;
4444
/** Event emitted every time the AccordionItem is closed. */
45-
@Output() closed: EventEmitter<void> = new EventEmitter<void>();
45+
@Output() readonly closed: EventEmitter<void> = new EventEmitter<void>();
4646
/** Event emitted every time the AccordionItem is opened. */
47-
@Output() opened: EventEmitter<void> = new EventEmitter<void>();
47+
@Output() readonly opened: EventEmitter<void> = new EventEmitter<void>();
4848
/** Event emitted when the AccordionItem is destroyed. */
49-
@Output() destroyed: EventEmitter<void> = new EventEmitter<void>();
49+
@Output() readonly destroyed: EventEmitter<void> = new EventEmitter<void>();
5050

5151
/**
5252
* Emits whenever the expanded state of the accordion changes.
5353
* Primarily used to facilitate two-way binding.
5454
* @docs-private
5555
*/
56-
@Output() expandedChange: EventEmitter<boolean> = new EventEmitter<boolean>();
56+
@Output() readonly expandedChange: EventEmitter<boolean> = new EventEmitter<boolean>();
5757

5858
/** The unique AccordionItem id. */
5959
readonly id: string = `cdk-accordion-child-${nextId++}`;

src/cdk/bidi/dir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class Dir implements Directionality, AfterContentInit, OnDestroy {
4040
_rawDir: string;
4141

4242
/** Event emitted when the direction changes. */
43-
@Output('dirChange') change = new EventEmitter<Direction>();
43+
@Output('dirChange') readonly change = new EventEmitter<Direction>();
4444

4545
/** @docs-private */
4646
@Input()

src/cdk/clipboard/copy-to-clipboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class CdkCopyToClipboard implements OnDestroy {
6060
* Emits when some text is copied to the clipboard. The
6161
* emitted value indicates whether copying was successful.
6262
*/
63-
@Output('cdkCopyToClipboardCopied') copied = new EventEmitter<boolean>();
63+
@Output('cdkCopyToClipboardCopied') readonly copied = new EventEmitter<boolean>();
6464

6565
/** Copies that are currently being attempted. */
6666
private _pending = new Set<PendingCopy>();

src/cdk/collections/selection-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class SelectionModel<T> {
3434
}
3535

3636
/** Event emitted when the value has changed. */
37-
changed: Subject<SelectionChange<T>> = new Subject();
37+
readonly changed = new Subject<SelectionChange<T>>();
3838

3939
constructor(
4040
private _multiple = false,

src/cdk/drag-drop/directives/drag-handle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class CdkDragHandle implements OnDestroy {
4141
_parentDrag: {} | undefined;
4242

4343
/** Emits when the state of the handle has changed. */
44-
_stateChanges = new Subject<CdkDragHandle>();
44+
readonly _stateChanges = new Subject<CdkDragHandle>();
4545

4646
/** Whether starting to drag through this handle is disabled. */
4747
@Input('cdkDragHandleDisabled')

src/cdk/drag-drop/directives/drag.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const DRAG_HOST_CLASS = 'cdk-drag';
7070
providers: [{provide: CDK_DRAG_PARENT, useExisting: CdkDrag}]
7171
})
7272
export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
73-
private _destroyed = new Subject<void>();
73+
private readonly _destroyed = new Subject<void>();
7474
private static _dragInstances: CdkDrag[] = [];
7575

7676
/** Reference to the underlying drag instance. */
@@ -156,32 +156,34 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
156156
@Input('cdkDragPreviewContainer') previewContainer: PreviewContainer;
157157

158158
/** Emits when the user starts dragging the item. */
159-
@Output('cdkDragStarted') started: EventEmitter<CdkDragStart> = new EventEmitter<CdkDragStart>();
159+
@Output('cdkDragStarted') readonly started: EventEmitter<CdkDragStart> =
160+
new EventEmitter<CdkDragStart>();
160161

161162
/** Emits when the user has released a drag item, before any animations have started. */
162-
@Output('cdkDragReleased') released: EventEmitter<CdkDragRelease> =
163+
@Output('cdkDragReleased') readonly released: EventEmitter<CdkDragRelease> =
163164
new EventEmitter<CdkDragRelease>();
164165

165166
/** Emits when the user stops dragging an item in the container. */
166-
@Output('cdkDragEnded') ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();
167+
@Output('cdkDragEnded') readonly ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();
167168

168169
/** Emits when the user has moved the item into a new container. */
169-
@Output('cdkDragEntered') entered: EventEmitter<CdkDragEnter<any>> =
170+
@Output('cdkDragEntered') readonly entered: EventEmitter<CdkDragEnter<any>> =
170171
new EventEmitter<CdkDragEnter<any>>();
171172

172173
/** Emits when the user removes the item its container by dragging it into another container. */
173-
@Output('cdkDragExited') exited: EventEmitter<CdkDragExit<any>> =
174+
@Output('cdkDragExited') readonly exited: EventEmitter<CdkDragExit<any>> =
174175
new EventEmitter<CdkDragExit<any>>();
175176

176177
/** Emits when the user drops the item inside a container. */
177-
@Output('cdkDragDropped') dropped: EventEmitter<CdkDragDrop<any>> =
178+
@Output('cdkDragDropped') readonly dropped: EventEmitter<CdkDragDrop<any>> =
178179
new EventEmitter<CdkDragDrop<any>>();
179180

180181
/**
181182
* Emits as the user is dragging the item. Use with caution,
182183
* because this event will fire for every pixel that the user has dragged.
183184
*/
184-
@Output('cdkDragMoved') moved: Observable<CdkDragMove<T>> =
185+
@Output('cdkDragMoved')
186+
readonly moved: Observable<CdkDragMove<T>> =
185187
new Observable((observer: Observer<CdkDragMove<T>>) => {
186188
const subscription = this._dragRef.moved.pipe(map(movedEvent => ({
187189
source: this,

src/cdk/drag-drop/directives/drop-list.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const CDK_DROP_LIST = new InjectionToken<CdkDropList>('CdkDropList');
7575
})
7676
export class CdkDropList<T = any> implements OnDestroy {
7777
/** Emits when the list has been destroyed. */
78-
private _destroyed = new Subject<void>();
78+
private readonly _destroyed = new Subject<void>();
7979

8080
/** Whether the element's scrollable parents have been resolved. */
8181
private _scrollableParentsResolved: boolean;
@@ -148,24 +148,24 @@ export class CdkDropList<T = any> implements OnDestroy {
148148

149149
/** Emits when the user drops an item inside the container. */
150150
@Output('cdkDropListDropped')
151-
dropped: EventEmitter<CdkDragDrop<T, any>> = new EventEmitter<CdkDragDrop<T, any>>();
151+
readonly dropped: EventEmitter<CdkDragDrop<T, any>> = new EventEmitter<CdkDragDrop<T, any>>();
152152

153153
/**
154154
* Emits when the user has moved a new drag item into this container.
155155
*/
156156
@Output('cdkDropListEntered')
157-
entered: EventEmitter<CdkDragEnter<T>> = new EventEmitter<CdkDragEnter<T>>();
157+
readonly entered: EventEmitter<CdkDragEnter<T>> = new EventEmitter<CdkDragEnter<T>>();
158158

159159
/**
160160
* Emits when the user removes an item from the container
161161
* by dragging it into another container.
162162
*/
163163
@Output('cdkDropListExited')
164-
exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();
164+
readonly exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();
165165

166166
/** Emits as the user is swapping items while actively dragging. */
167167
@Output('cdkDropListSorted')
168-
sorted: EventEmitter<CdkDragSortEvent<T>> = new EventEmitter<CdkDragSortEvent<T>>();
168+
readonly sorted: EventEmitter<CdkDragSortEvent<T>> = new EventEmitter<CdkDragSortEvent<T>>();
169169

170170
/**
171171
* Keeps track of the items that are registered with this container. Historically we used to

0 commit comments

Comments
 (0)