Skip to content

Commit

Permalink
docs: fix ngProjectAs selector in example (#42523)
Browse files Browse the repository at this point in the history
Fixes #42522

PR Close #42523
  • Loading branch information
petebacondarwin authored and alxhub committed Jun 9, 2021
1 parent 28a4631 commit e36c5b4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Expand Up @@ -34,7 +34,7 @@ <h2>Here's a zippy</h2>
<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-->
Expand Down
Expand Up @@ -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>
`
})
Expand Down
Expand Up @@ -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>
`
})
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/content-projection.md
Expand Up @@ -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.

0 comments on commit e36c5b4

Please sign in to comment.