Skip to content

Commit 8ebff76

Browse files
committed
Added documentation and small typing fix
1 parent 872cf53 commit 8ebff76

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>;
@@ -266,6 +266,11 @@ export class MdSelect implements AfterContentInit, OnDestroy, OnInit, ControlVal
266266
this._multiple = coerceBooleanProperty(value);
267267
}
268268

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

0 commit comments

Comments
 (0)