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

Method withOrientation

src/cdk/drag-drop/drop-list-ref.ts:376–388  ·  view source on GitHub ↗

* Sets the orientation of the container. * @param orientation New orientation for the container.

(orientation: DropListOrientation)

Source from the content-addressed store, hash-verified

374 * @param orientation New orientation for the container.
375 */
376 withOrientation(orientation: DropListOrientation): this {
377 if (orientation === 'mixed') {
378 this._sortStrategy = new MixedSortStrategy(this._document, this._dragDropRegistry);
379 } else {
380 const strategy = new SingleAxisSortStrategy(this._dragDropRegistry);
381 strategy.direction = this._direction;
382 strategy.orientation = orientation;
383 this._sortStrategy = strategy;
384 }
385 this._sortStrategy.withElementContainer(this._container);
386 this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this));
387 return this;
388 }
389
390 /**
391 * Sets which parent elements are can be scrolled while the user is dragging.

Callers 2

constructorMethod · 0.95

Calls 2

withElementContainerMethod · 0.65
withSortPredicateMethod · 0.65

Tested by

no test coverage detected