diff --git a/src/material/chips/chip-input.ts b/src/material/chips/chip-input.ts index b4b2d9428e32..e0a8161c06a6 100644 --- a/src/material/chips/chip-input.ts +++ b/src/material/chips/chip-input.ts @@ -75,16 +75,19 @@ export class MatChipInput implements MatChipTextControl, AfterContentInit, OnCha /** Whether the control is focused. */ focused: boolean = false; - _chipGrid: MatChipGrid; /** Register input for chip list */ @Input('matChipInputFor') + get chipGrid(): MatChipGrid { + return this._chipGrid; + } set chipGrid(value: MatChipGrid) { if (value) { this._chipGrid = value; this._chipGrid.registerInput(this); } } + private _chipGrid: MatChipGrid; /** * Whether or not the chipEnd event will be emitted when the input is blurred. diff --git a/src/material/chips/chip-set.ts b/src/material/chips/chip-set.ts index e85da22a55d0..45ae22bc0eb4 100644 --- a/src/material/chips/chip-set.ts +++ b/src/material/chips/chip-set.ts @@ -80,11 +80,16 @@ export class MatChipSet return this._getChipStream(chip => chip._onFocus); } - /** Combined stream of all of the child chips' remove events. */ + /** Combined stream of all of the child chips' destroy events. */ get chipDestroyedChanges(): Observable { return this._getChipStream(chip => chip.destroyed); } + /** Combined stream of all of the child chips' remove events. */ + get chipRemovedChanges(): Observable { + return this._getChipStream(chip => chip.removed); + } + /** Whether the chip set is disabled. */ @Input() get disabled(): boolean { diff --git a/tools/public_api_guard/material/chips.md b/tools/public_api_guard/material/chips.md index 66a167b61624..68bd23b21a63 100644 --- a/tools/public_api_guard/material/chips.md +++ b/tools/public_api_guard/material/chips.md @@ -243,6 +243,7 @@ export class MatChipInput implements MatChipTextControl, AfterContentInit, OnCha _addOnBlur: boolean; _blur(): void; readonly chipEnd: EventEmitter; + get chipGrid(): MatChipGrid; set chipGrid(value: MatChipGrid); // (undocumented) _chipGrid: MatChipGrid; @@ -443,6 +444,7 @@ export class MatChipSet extends _MatChipSetMixinBase implements AfterViewInit, H _chipActions: QueryList; get chipDestroyedChanges(): Observable; get chipFocusChanges(): Observable; + get chipRemovedChanges(): Observable; _chips: QueryList; protected _defaultRole: string; protected _destroyed: Subject;