docs: update example references from "my-app" to "app-root" (#30789)
"app" is the default prefix for CLI projects when generating components. This updates our examples to conform that that default Closes #19778 PR Close #30789
This commit is contained in:
parent
32886cf9ac
commit
8bedf50073
|
@ -12,7 +12,7 @@ import { Component } from '@angular/core';
|
||||||
// #enddocregion import-core-component
|
// #enddocregion import-core-component
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
template: 'Welcome to Angular'
|
template: 'Welcome to Angular'
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Component } from '@angular/core';
|
||||||
import { heroes } from './hero';
|
import { heroes } from './hero';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.css']
|
styleUrls: ['./app.component.css']
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<body>
|
<body>
|
||||||
<my-app>Loading...</my-apps>
|
<app-root>Loading...</app-root>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
template: `<h1>Hello {{name}}</h1>`
|
template: `<h1>Hello {{name}}</h1>`
|
||||||
})
|
})
|
||||||
export class AppComponent { name = 'Angular'; }
|
export class AppComponent { name = 'Angular'; }
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<!-- #docregion my-app-->
|
<!-- #docregion app-root-->
|
||||||
<my-app><!-- content managed by Angular --></my-app>
|
<app-root><!-- content managed by Angular --></app-root>
|
||||||
<!-- #enddocregion my-app-->
|
<!-- #enddocregion app-root-->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -10,7 +10,7 @@ class Hero {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'app-root',
|
||||||
template: `
|
template: `
|
||||||
<h1>{{title}}</h1>
|
<h1>{{title}}</h1>
|
||||||
<pre>{{heroes | json}}</pre>
|
<pre>{{heroes | json}}</pre>
|
||||||
|
|
Loading…
Reference in New Issue