MCPcopy Index your code
hub / github.com/angular/components / constructor

Method constructor

src/cdk/collections/selection-model.ts:54–70  ·  view source on GitHub ↗
(
    private _multiple = false,
    initiallySelectedValues?: T[],
    private _emitChanges = true,
    public compareWith?: (o1: T, o2: T) => boolean,
  )

Source from the content-addressed store, hash-verified

52 };
53
54 constructor(
55 private _multiple = false,
56 initiallySelectedValues?: T[],
57 private _emitChanges = true,
58 public compareWith?: (o1: T, o2: T) => boolean,
59 ) {
60 if (initiallySelectedValues && initiallySelectedValues.length) {
61 if (_multiple) {
62 initiallySelectedValues.forEach(value => this._markSelected(value));
63 } else {
64 this._markSelected(initiallySelectedValues[0]);
65 }
66
67 // Clear the array in order to avoid firing the change event for preselected values.
68 this._selectedToEmit.length = 0;
69 }
70 }
71
72 /**
73 * Selects a value or an array of values.

Callers

nothing calls this directly

Calls 1

_markSelectedMethod · 0.95

Tested by

no test coverage detected