From c2ed612da3b0ad70c9ead1ff70a528a573fe44e1 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Sun, 23 May 2021 20:40:01 +0100 Subject: [PATCH] docs: convert the last `my-app` components to `app-root` (#42256) Most of these were fixed in other PRs but there were are couple of stragglers. Note that `my-app` components in non-documentation facing code, such as compliance tests have not been changed. Fixes #20235 PR Close #42256 --- .../src/app/app.component.ts | 2 +- .../routing-with-urlmatcher/src/index.html | 2 +- aio/content/guide/template-typecheck.md | 2 +- .../src/render3/STORING_METADATA_IN_D.TS.md | 2 +- .../core/src/render3/util/discovery_utils.ts | 28 +++++++++++-------- packages/core/src/render3/view_ref.ts | 4 +-- .../compiler/ts/url_resolver/url_resolver.ts | 2 +- .../examples/core/ts/bootstrap/bootstrap.ts | 2 +- .../core/ts/change_detect/change-detection.ts | 2 +- .../core/ts/metadata/encapsulation.ts | 2 +- .../examples/core/ts/platform/platform.ts | 2 +- packages/private/testing/src/render3.ts | 2 +- 12 files changed, 29 insertions(+), 23 deletions(-) diff --git a/aio/content/examples/routing-with-urlmatcher/src/app/app.component.ts b/aio/content/examples/routing-with-urlmatcher/src/app/app.component.ts index f9ed12b95b..6c65750024 100644 --- a/aio/content/examples/routing-with-urlmatcher/src/app/app.component.ts +++ b/aio/content/examples/routing-with-urlmatcher/src/app/app.component.ts @@ -1,7 +1,7 @@ import { Component, VERSION } from '@angular/core'; @Component({ - selector: 'my-app', + selector: 'app-root', templateUrl: './app.component.html', styleUrls: [ './app.component.css' ] }) diff --git a/aio/content/examples/routing-with-urlmatcher/src/index.html b/aio/content/examples/routing-with-urlmatcher/src/index.html index 47f5b41707..768de5699e 100644 --- a/aio/content/examples/routing-with-urlmatcher/src/index.html +++ b/aio/content/examples/routing-with-urlmatcher/src/index.html @@ -4,6 +4,6 @@ Angular App - loading + loading \ No newline at end of file diff --git a/aio/content/guide/template-typecheck.md b/aio/content/guide/template-typecheck.md index 3891a8584f..0a5963ff9c 100644 --- a/aio/content/guide/template-typecheck.md +++ b/aio/content/guide/template-typecheck.md @@ -156,7 +156,7 @@ The `AppComponent` template uses this component as follows: ```ts @Component({ - selector: 'my-app', + selector: 'app-root', template: '', }) export class AppComponent { diff --git a/packages/core/src/render3/STORING_METADATA_IN_D.TS.md b/packages/core/src/render3/STORING_METADATA_IN_D.TS.md index c5e73c7570..04f432d5da 100644 --- a/packages/core/src/render3/STORING_METADATA_IN_D.TS.md +++ b/packages/core/src/render3/STORING_METADATA_IN_D.TS.md @@ -17,7 +17,7 @@ export class TooltipDirective { } @Component({ - selector: 'my-app', + selector: 'app-root', template: 'Hello World!' }) class MyAppComponent { diff --git a/packages/core/src/render3/util/discovery_utils.ts b/packages/core/src/render3/util/discovery_utils.ts index 430df1bf2d..b204aab10d 100644 --- a/packages/core/src/render3/util/discovery_utils.ts +++ b/packages/core/src/render3/util/discovery_utils.ts @@ -31,17 +31,19 @@ import {getTNode, unwrapRNode} from './view_utils'; * * @usageNotes * Given the following DOM structure: + * * ```html - * + * *
* *
- *
+ * * ``` + * * Calling `getComponent` on `` will return the instance of `ChildComponent` * associated with this DOM element. * - * Calling the function on `` will return the `MyApp` instance. + * Calling the function on `` will return the `MyApp` instance. * * * @param element DOM element from which the component should be retrieved. @@ -177,12 +179,14 @@ export function getInjectionTokens(element: Element): any[] { * * @usageNotes * Given the following DOM structure: - * ``` - * + * + * ```html + * * * - * + * * ``` + * * Calling `getDirectives` on `