(
private _multiple = false,
initiallySelectedValues?: T[],
private _emitChanges = true,
public compareWith?: (o1: T, o2: T) => boolean,
)
| 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. |
nothing calls this directly
no test coverage detected