MCPcopy Create free account
hub / github.com/angular/components / ngAfterContentInit

Method ngAfterContentInit

src/material/chips/chip-listbox.ts:199–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197 override _chips: QueryList<MatChipOption> = undefined!;
198
199 ngAfterContentInit() {
200 this._chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
201 if (this.value !== undefined) {
202 Promise.resolve().then(() => {
203 this._setSelectionByValue(this.value, false);
204 });
205 }
206 // Update listbox selectable/multiple properties on chips
207 this._syncListboxProperties();
208 });
209
210 this.chipBlurChanges.pipe(takeUntil(this._destroyed)).subscribe(() => this._blur());
211 this.chipSelectionChanges.pipe(takeUntil(this._destroyed)).subscribe(event => {
212 if (!this.multiple) {
213 this._chips.forEach(chip => {
214 if (chip !== event.source) {
215 chip._setSelectedState(false, false, false);
216 }
217 });
218 }
219
220 if (event.isUserInput) {
221 this._propagateChanges();
222 }
223 });
224 }
225
226 /**
227 * Focuses the first selected chip in this chip listbox, or the first non-disabled chip when there

Callers

nothing calls this directly

Calls 6

_setSelectionByValueMethod · 0.95
_blurMethod · 0.95
_propagateChangesMethod · 0.95
resolveMethod · 0.80
_setSelectedStateMethod · 0.80

Tested by

no test coverage detected