docs: fix `ngProjectAs` selector in example (#42523)
Fixes #42522 PR Close #42523
This commit is contained in:
parent
28a4631b63
commit
e36c5b4c86
|
@ -34,7 +34,7 @@
|
|||
<app-zippy-ngprojectas>
|
||||
<p>Let's learn about content projection!</p>
|
||||
<!-- #docregion ngprojectas-->
|
||||
<ng-container ngProjectAs="question">
|
||||
<ng-container ngProjectAs="[question]">
|
||||
<p>Is content projection cool?</p>
|
||||
</ng-container>
|
||||
<!-- #enddocregion-->
|
||||
|
|
|
@ -4,7 +4,9 @@ import { Component } from '@angular/core';
|
|||
selector: 'app-zippy-multislot',
|
||||
template: `
|
||||
<h2>Multi-slot content projection</h2>
|
||||
Default:
|
||||
<ng-content></ng-content>
|
||||
Question:
|
||||
<ng-content select="[question]"></ng-content>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -4,7 +4,9 @@ import { Component } from '@angular/core';
|
|||
selector: 'app-zippy-ngprojectas',
|
||||
template: `
|
||||
<h2>Content projection with ngProjectAs</h2>
|
||||
Default:
|
||||
<ng-content></ng-content>
|
||||
Question:
|
||||
<ng-content select="[question]"></ng-content>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -154,4 +154,4 @@ The `ng-container` element is a logical construct that you can use to group othe
|
|||
|
||||
</div>
|
||||
|
||||
In this example, the content we want to project resides inside another element. To project this content as intended, the template uses the `ngProjectAs` attribute. With `ngProjectAs`, the entire `ng-container` element is projected into a component using the `question` selector.
|
||||
In this example, the content we want to project resides inside another element. To project this content as intended, the template uses the `ngProjectAs` attribute. With `ngProjectAs`, the entire `ng-container` element is projected into a component using the `[question]` selector.
|
||||
|
|
Loading…
Reference in New Issue