mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs: Changed documentation for providers vs. viewProviders (#47281)
Content in ```<ng-content></ng-content>``` sees ```viewProviders``` from ```app-root``` PR Close #47281
This commit is contained in:
@@ -636,13 +636,18 @@ The `AnimalService` in the logical tree would look like this:
|
||||
@Inject(AnimalService=>"🐶")>
|
||||
<!-- ^^using viewProviders means AnimalService is available in <#VIEW>-->
|
||||
<p>Emoji from AnimalService: {{animal.emoji}} (🐶)</p>
|
||||
<app-inspector>
|
||||
<p>Emoji from AnimalService: {{animal.emoji}} (🐶)</p>
|
||||
</app-inspector>
|
||||
|
||||
<div class="container">
|
||||
<h3>Content projection</h3>
|
||||
<app-inspector @Inject(AnimalService) animal=>"🐳">
|
||||
<p>Emoji from AnimalService: {{animal.emoji}} (🐳)</p>
|
||||
</app-inspector>
|
||||
</div>
|
||||
|
||||
</#VIEW>
|
||||
<app-inspector>
|
||||
<#VIEW>
|
||||
<p>Emoji from AnimalService: {{animal.emoji}} (🐳)</p>
|
||||
<p>Emoji from AnimalService: {{animal.emoji}} (🐶)</p>
|
||||
</#VIEW>
|
||||
</app-inspector>
|
||||
</app-child>
|
||||
|
||||
Reference in New Issue
Block a user