Skip to content

Commit

Permalink
Added documentation and small typing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ppham27 committed May 14, 2017
1 parent 872cf53 commit 8ebff76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class MdSelect implements AfterContentInit, OnDestroy, OnInit, ControlVal
private _multiple: boolean = false;

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

/** Deals with the selection logic. */
_selectionModel: SelectionModel<MdOption>;
Expand Down Expand Up @@ -266,6 +266,11 @@ export class MdSelect implements AfterContentInit, OnDestroy, OnInit, ControlVal
this._multiple = coerceBooleanProperty(value);
}

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

0 comments on commit 8ebff76

Please sign in to comment.