Skip to content

Commit 99b09ad

Browse files
committed
Added documentation and small typing fix
1 parent e466ede commit 99b09ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib/select/select.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class MdSelect implements AfterContentInit, OnDestroy, OnInit, ControlVal
152152
private _multiple: boolean = false;
153153

154154
/** Comparison function to specify which option is displayed. Defaults to object equality. */
155-
private _compareWith: ((o1: any, o2: any) => boolean) | null = null;
155+
private _compareWith: (o1: any, o2: any) => boolean;
156156

157157
/** Deals with the selection logic. */
158158
_selectionModel: SelectionModel<MdOption>;
@@ -269,6 +269,11 @@ export class MdSelect implements AfterContentInit, OnDestroy, OnInit, ControlVal
269269
this._multiple = coerceBooleanProperty(value);
270270
}
271271

272+
/**
273+
* A function to compare the option values with the selected values. The first argument
274+
* is a value from an option. The second is a value from the selection. A boolean
275+
* should be returned.
276+
*/
272277
@Input()
273278
get compareWith() { return this._compareWith; }
274279
set compareWith(fn: (o1: any, o2: any) => boolean) {

0 commit comments

Comments
 (0)