docs: remove service from region where it was added before it was created (#35354)

The message service was added in a section create message service but was impoted much before it removed those imports because they can be confusing

Fixes #35259

PR Close #35354
This commit is contained in:
ajitsinghkaler 2020-02-12 09:09:02 +05:30 committed by Kara Erickson
parent a6aa35e598
commit e8ea3be843
3 changed files with 4 additions and 4 deletions

View File

@ -5,9 +5,9 @@ import { Observable } from 'rxjs';
class DummyHeroesComponent {
heroes: Observable<Hero[]>;
// #docregion ctor
constructor(private heroService: HeroService) {}
// #enddocregion ctor
// #docregion getHeroes
getHeroes(): void {
// #docregion get-heroes

View File

@ -5,8 +5,8 @@ import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
// #docregion hero-service-import
import { HeroService } from '../hero.service';
import { MessageService } from '../message.service';
// #enddocregion hero-service-import
import { MessageService } from '../message.service';
@Component({
selector: 'app-heroes',

View File

@ -122,7 +122,7 @@ Replace the definition of the `heroes` property with a simple declaration.
Add a private `heroService` parameter of type `HeroService` to the constructor.
<code-example path="toh-pt4/src/app/heroes/heroes.component.ts" header="src/app/heroes/heroes.component.ts" region="ctor">
<code-example path="toh-pt4/src/app/heroes/heroes.component.1.ts" header="src/app/heroes/heroes.component.ts" region="ctor">
</code-example>
The parameter simultaneously defines a private `heroService` property and identifies it as a `HeroService` injection site.