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

Function ngAfterContentChecked

src/material/tabs/paginated-tab-header.ts:300–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298 }
299
300 ngAfterContentChecked(): void {
301 // If the number of tab labels have changed, check if scrolling should be enabled
302 if (this._tabLabelCount != this._items.length) {
303 this.updatePagination();
304 this._tabLabelCount = this._items.length;
305 this._changeDetectorRef.markForCheck();
306 }
307
308 // If the selected index has changed, scroll to the label and check if the scrolling controls
309 // should be disabled.
310 if (this._selectedIndexChanged) {
311 this._scrollToLabel(this._selectedIndex);
312 this._checkScrollingControls();
313 this._alignInkBarToSelectedTab();
314 this._selectedIndexChanged = false;
315 this._changeDetectorRef.markForCheck();
316 }
317
318 // If the scroll distance has been changed (tab selected, focused, scroll controls activated),
319 // then translate the header to reflect this.
320 if (this._scrollDistanceChanged) {
321 this._updateTabScrollPosition();
322 this._scrollDistanceChanged = false;
323 this._changeDetectorRef.markForCheck();
324 }
325 }
326
327 ngOnDestroy() {
328 this._eventCleanups.forEach(cleanup => cleanup());

Callers

nothing calls this directly

Calls 3

markForCheckMethod · 0.80
updatePaginationMethod · 0.65

Tested by

no test coverage detected