MCPcopy Create free account
hub / github.com/angular/components / constructor

Method constructor

src/cdk/drag-drop/directives/drop-list.ts:197–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195 private _unsortedItems = new Set<CdkDrag>();
196
197 constructor() {
198 const config = inject<DragDropConfig>(CDK_DRAG_CONFIG, {optional: true});
199 const injector = inject(Injector);
200
201 if (typeof ngDevMode === 'undefined' || ngDevMode) {
202 assertElementNode(this.element.nativeElement, 'cdkDropList');
203 }
204
205 this._dropListRef = createDropListRef(injector, this.element);
206 this._dropListRef.data = this;
207
208 if (config) {
209 this._assignDefaults(config);
210 }
211
212 this._dropListRef.enterPredicate = (drag: DragRef<CdkDrag>, drop: DropListRef<CdkDropList>) => {
213 return this.enterPredicate(drag.data, drop.data);
214 };
215
216 this._dropListRef.sortPredicate = (
217 index: number,
218 drag: DragRef<CdkDrag>,
219 drop: DropListRef<CdkDropList>,
220 ) => {
221 return this.sortPredicate(index, drag.data, drop.data);
222 };
223
224 this._setupInputSyncSubscription(this._dropListRef);
225 this._handleEvents(this._dropListRef);
226 CdkDropList._dropLists.push(this);
227
228 if (this._group) {
229 this._group._items.add(this);
230 }
231 }
232
233 /** Registers an items with the drop list. */
234 addItem(item: CdkDrag): void {

Callers

nothing calls this directly

Calls 7

_assignDefaultsMethod · 0.95
_handleEventsMethod · 0.95
assertElementNodeFunction · 0.90
createDropListRefFunction · 0.90
pushMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected