Skip to content

Commit c89c30f

Browse files
committed
main - 5897f37 refactor(multiple): switch material to the inject function (#29731)
1 parent d4a5e52 commit c89c30f

16 files changed

+41
-46
lines changed

docs-content/api-docs/cdk-portal.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,6 @@ <h4 id="CdkPortalOutlet" class="docs-header-link docs-api-h4 docs-api-class-name
560560
Deprecated
561561
</div><p class="docs-api-property-name">
562562
<code>attachDomPortal: (portal: DomPortal) =&gt; {
563-
if (!this._document &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
564-
throw Error(&#39;Cannot attach DOM portal without _document constructor parameter&#39;);
565-
}
566563
const element = portal.element;
567564
if (!element.parentNode &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
568565
throw Error(&#39;DOM portal content must be attached to a parent node.&#39;);
@@ -972,9 +969,6 @@ <h4 id="PortalHostDirective" class="docs-header-link docs-api-h4 docs-api-class-
972969
Deprecated
973970
</div><p class="docs-api-property-name">
974971
<code>attachDomPortal: (portal: DomPortal) =&gt; {
975-
if (!this._document &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
976-
throw Error(&#39;Cannot attach DOM portal without _document constructor parameter&#39;);
977-
}
978972
const element = portal.element;
979973
if (!element.parentNode &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
980974
throw Error(&#39;DOM portal content must be attached to a parent node.&#39;);
@@ -2732,9 +2726,6 @@ <h4 id="DomPortalOutlet" class="docs-header-link docs-api-h4 docs-api-class-name
27322726
Deprecated
27332727
</div><p class="docs-api-property-name">
27342728
<code>attachDomPortal: (portal: DomPortal) =&gt; {
2735-
if (!this._document &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
2736-
throw Error(&#39;Cannot attach DOM portal without _document constructor parameter&#39;);
2737-
}
27382729
const element = portal.element;
27392730
if (!element.parentNode &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
27402731
throw Error(&#39;DOM portal content must be attached to a parent node.&#39;);
@@ -3107,9 +3098,6 @@ <h4 id="DomPortalHost" class="docs-header-link docs-api-h4 docs-api-class-name">
31073098
Deprecated
31083099
</div><p class="docs-api-property-name">
31093100
<code>attachDomPortal: (portal: DomPortal) =&gt; {
3110-
if (!this._document &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
3111-
throw Error(&#39;Cannot attach DOM portal without _document constructor parameter&#39;);
3112-
}
31133101
const element = portal.element;
31143102
if (!element.parentNode &amp;&amp; (typeof ngDevMode === &#39;undefined&#39; || ngDevMode)) {
31153103
throw Error(&#39;DOM portal content must be attached to a parent node.&#39;);

docs-content/api-docs/material-autocomplete.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,10 @@ <h4 id="MatAutocompleteOrigin" class="docs-header-link docs-api-h4 docs-api-clas
361361

362362
<tr class="docs-api-properties-row">
363363
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
364-
<code>elementRef: ElementRef&lt;HTMLElement&gt;</code>
364+
<code>elementRef: inject&lt;ElementRef&lt;HTMLElement&gt;&gt;(ElementRef)</code>
365365
</p>
366366
</td>
367-
<td class="docs-api-property-description"><p>Reference to the element on which the directive is applied.</p>
368-
</td>
367+
<td class="docs-api-property-description"></td>
369368
</tr>
370369

371370

docs-content/api-docs/material-chips.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ <h4 id="MatChipGrid" class="docs-header-link docs-api-h4 docs-api-class-name">
17871787

17881788
<tr class="docs-api-properties-row">
17891789
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
1790-
<code>ngControl: NgControl</code>
1790+
<code>ngControl: inject(NgControl, { optional: true, self: true })!</code>
17911791
</p>
17921792
</td>
17931793
<td class="docs-api-property-description"></td>

docs-content/api-docs/material-core.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ <h5 class="docs-api-h5 docs-api-method-header">Methods</h5>
14381438
<td class="docs-api-method-parameter-cell">
14391439
<p class="docs-api-method-parameter-name">
14401440
form</p>
1441-
<code class="docs-api-method-parameter-type">NgForm | FormGroupDirective</code>
1441+
<code class="docs-api-method-parameter-type">FormGroupDirective | NgForm</code>
14421442
</td>
14431443
<td class="docs-api-method-parameter-description-cell">
14441444
<p class="docs-api-method-parameter-description">
@@ -1511,7 +1511,7 @@ <h5 class="docs-api-h5 docs-api-method-header">Methods</h5>
15111511
<td class="docs-api-method-parameter-cell">
15121512
<p class="docs-api-method-parameter-name">
15131513
form</p>
1514-
<code class="docs-api-method-parameter-type">NgForm | FormGroupDirective</code>
1514+
<code class="docs-api-method-parameter-type">FormGroupDirective | NgForm</code>
15151515
</td>
15161516
<td class="docs-api-method-parameter-description-cell">
15171517
<p class="docs-api-method-parameter-description">
@@ -1654,7 +1654,7 @@ <h4 id="MatOption" class="docs-header-link docs-api-h4 docs-api-class-name">
16541654

16551655
<tr class="docs-api-properties-row">
16561656
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
1657-
<code>group: MatOptgroup</code>
1657+
<code>group: inject&lt;MatOptgroup&gt;(MAT_OPTGROUP, { optional: true })</code>
16581658
</p>
16591659
</td>
16601660
<td class="docs-api-property-description"></td>

docs-content/api-docs/material-datepicker.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ <h4 id="MatCalendarHeader" class="docs-header-link docs-api-h4 docs-api-class-na
17731773

17741774
<tr class="docs-api-properties-row">
17751775
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
1776-
<code>calendar: MatCalendar&lt;D&gt;</code>
1776+
<code>calendar: inject&lt;MatCalendar&lt;D&gt;&gt;(MatCalendar)</code>
17771777
</p>
17781778
</td>
17791779
<td class="docs-api-property-description"></td>

docs-content/api-docs/material-dialog-testing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h4 id="MatTestDialogOpener" class="docs-header-link docs-api-h4 docs-api-class-
9090

9191
<tr class="docs-api-properties-row">
9292
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
93-
<code>dialog: MatDialog</code>
93+
<code>dialog: inject(MatDialog)</code>
9494
</p>
9595
</td>
9696
<td class="docs-api-property-description"></td>

docs-content/api-docs/material-dialog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ <h4 id="MatDialogClose" class="docs-header-link docs-api-h4 docs-api-class-name"
475475

476476
<tr class="docs-api-properties-row">
477477
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
478-
<code>dialogRef: MatDialogRef&lt;any&gt;</code>
478+
<code>dialogRef: inject&lt;MatDialogRef&lt;any&gt;&gt;(MatDialogRef, { optional: true })!</code>
479479
</p>
480480
</td>
481481
<td class="docs-api-property-description"></td>

docs-content/api-docs/material-expansion.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ <h4 id="MatExpansionPanel" class="docs-header-link docs-api-h4 docs-api-class-na
330330

331331
<tr class="docs-api-properties-row">
332332
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
333-
<code>accordion: MatAccordionBase</code>
333+
<code>accordion: inject&lt;MatAccordionBase&gt;(MAT_ACCORDION, { optional: true, skipSelf: true })!</code>
334334
</p>
335335
</td>
336336
<td class="docs-api-property-description"><p>Optionally defined accordion the expansion panel belongs to.</p>
@@ -483,7 +483,7 @@ <h4 id="MatExpansionPanelHeader" class="docs-header-link docs-api-h4 docs-api-cl
483483

484484
<tr class="docs-api-properties-row">
485485
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
486-
<code>panel: MatExpansionPanel</code>
486+
<code>panel: inject(MatExpansionPanel, { host: true })</code>
487487
</p>
488488
</td>
489489
<td class="docs-api-property-description"></td>

docs-content/api-docs/material-input.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ <h4 id="MatInput" class="docs-header-link docs-api-h4 docs-api-class-name">
128128

129129
<tr class="docs-api-properties-row">
130130
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
131-
<code>ngControl: NgControl</code>
131+
<code>ngControl: inject(NgControl, { optional: true, self: true })!</code>
132132
</p>
133133
</td>
134134
<td class="docs-api-property-description"></td>

docs-content/api-docs/material-select.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ <h4 id="MatSelect" class="docs-header-link docs-api-h4 docs-api-class-name">
388388

389389
<tr class="docs-api-properties-row">
390390
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
391-
<code>ngControl: NgControl</code>
391+
<code>ngControl: inject(NgControl, { self: true, optional: true })!</code>
392392
</p>
393393
</td>
394394
<td class="docs-api-property-description"></td>

0 commit comments

Comments
 (0)