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

Method constructor

src/aria/tabs/tab.ts:94–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 }
93
94 constructor() {
95 // Automatically prevent form submission.
96 if (this.element.tagName === 'BUTTON' && !this.element.hasAttribute('type')) {
97 this.element.setAttribute('type', 'button');
98 }
99
100 if (typeof ngDevMode === 'undefined' || ngDevMode) {
101 afterRenderEffect({
102 read: () => {
103 const violations: string[] = [];
104 if (this._tabList && this._tabList._tabsParent) {
105 if (!this._tabList._tabsParent._panelMap().has(this.value())) {
106 violations.push(
107 `ngTab with value '${this.value()}' does not have a corresponding ngTabPanel.`,
108 );
109 }
110 }
111 reportViolations(violations, this.element);
112 },
113 });
114 }
115 }
116
117 ngOnInit() {
118 this._tabList._collection.register(this);

Callers

nothing calls this directly

Calls 3

reportViolationsFunction · 0.90
pushMethod · 0.65
valueMethod · 0.45

Tested by

no test coverage detected