Skip to content

Commit 02eef05

Browse files
devversionjelbourn
authored andcommitted
chore: hide internal properties from selection-list api doc (#8841)
* Recently with the NgModel support for the selection list, the `onTouched` property has been added. This one needs to be prefixed with an underscore to be hidden in the docs. * Since the initial implementation of the selection-list the `selectionList` variable has been initialized publically in the constructor of the `MatListOption` and therefore shows up in the docs. This property has been made private now.
1 parent fda978a commit 02eef05

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/list/selection-list.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class MatListOption extends _MatListOptionMixinBase
130130

131131
/** Whether the option is disabled. */
132132
@Input()
133-
get disabled() { return (this.selectionList && this.selectionList.disabled) || this._disabled; }
133+
get disabled() { return this._disabled || (this.selectionList && this.selectionList.disabled); }
134134
set disabled(value: any) {
135135
const newValue = coerceBooleanProperty(value);
136136

@@ -161,7 +161,7 @@ export class MatListOption extends _MatListOptionMixinBase
161161

162162
constructor(private _element: ElementRef,
163163
private _changeDetector: ChangeDetectorRef,
164-
@Optional() @Inject(forwardRef(() => MatSelectionList))
164+
/** @docs-private */ @Optional() @Inject(forwardRef(() => MatSelectionList))
165165
public selectionList: MatSelectionList) {
166166
super();
167167
}
@@ -233,7 +233,7 @@ export class MatListOption extends _MatListOptionMixinBase
233233

234234
_handleBlur() {
235235
this._hasFocus = false;
236-
this.selectionList.onTouched();
236+
this.selectionList._onTouched();
237237
}
238238

239239
/** Retrieves the DOM element of the component host. */
@@ -279,7 +279,7 @@ export class MatListOption extends _MatListOptionMixinBase
279279
'[tabIndex]': 'tabIndex',
280280
'class': 'mat-selection-list',
281281
'(focus)': 'focus()',
282-
'(blur)': 'onTouched()',
282+
'(blur)': '_onTouched()',
283283
'(keydown)': '_keydown($event)',
284284
'[attr.aria-disabled]': 'disabled.toString()'},
285285
template: '<ng-content></ng-content>',
@@ -312,7 +312,7 @@ export class MatSelectionList extends _MatSelectionListMixinBase implements Focu
312312
private _tempValues: string[]|null;
313313

314314
/** View to model callback that should be called if the list or its options lost focus. */
315-
onTouched: () => void = () => {};
315+
_onTouched: () => void = () => {};
316316

317317
constructor(private _element: ElementRef, @Attribute('tabindex') tabIndex: string) {
318318
super();
@@ -420,7 +420,7 @@ export class MatSelectionList extends _MatSelectionListMixinBase implements Focu
420420

421421
/** Implemented as part of ControlValueAccessor. */
422422
registerOnTouched(fn: () => void): void {
423-
this.onTouched = fn;
423+
this._onTouched = fn;
424424
}
425425

426426
/** Returns the option with the specified value. */

0 commit comments

Comments
 (0)