From 3658e25f2eb884fc0b1cea0203a5244d7c592581 Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Wed, 30 Aug 2023 10:20:16 -0700 Subject: [PATCH] docs: migrate toh-pt0 to standalone (#51575) PR Close #51575 --- .../examples/toh-pt0/src/app/app.component.ts | 9 +++++---- .../examples/toh-pt0/src/app/app.module.ts | 16 ---------------- aio/content/examples/toh-pt0/src/main.ts | 9 +++++---- aio/content/tutorial/tour-of-heroes/toh-pt0.md | 2 +- 4 files changed, 11 insertions(+), 25 deletions(-) delete mode 100644 aio/content/examples/toh-pt0/src/app/app.module.ts diff --git a/aio/content/examples/toh-pt0/src/app/app.component.ts b/aio/content/examples/toh-pt0/src/app/app.component.ts index 8391a7e6451d4..23f7b99a6c06f 100644 --- a/aio/content/examples/toh-pt0/src/app/app.component.ts +++ b/aio/content/examples/toh-pt0/src/app/app.component.ts @@ -1,12 +1,13 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; @Component({ + standalone: true, selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], }) export class AppComponent { -// #docregion set-title + // #docregion set-title title = 'Tour of Heroes'; -// #enddocregion set-title + // #enddocregion set-title } diff --git a/aio/content/examples/toh-pt0/src/app/app.module.ts b/aio/content/examples/toh-pt0/src/app/app.module.ts deleted file mode 100644 index f65716351aa59..0000000000000 --- a/aio/content/examples/toh-pt0/src/app/app.module.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; - -import { AppComponent } from './app.component'; - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/aio/content/examples/toh-pt0/src/main.ts b/aio/content/examples/toh-pt0/src/main.ts index 0a621147e305c..46d4cf887072f 100644 --- a/aio/content/examples/toh-pt0/src/main.ts +++ b/aio/content/examples/toh-pt0/src/main.ts @@ -1,6 +1,7 @@ -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; +import {AppComponent} from './app/app.component'; -platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.error(err)); +bootstrapApplication(AppComponent, { + providers: [provideProtractorTestingSupport()], +}); diff --git a/aio/content/tutorial/tour-of-heroes/toh-pt0.md b/aio/content/tutorial/tour-of-heroes/toh-pt0.md index 34ea177b38ff5..a125250102a2c 100644 --- a/aio/content/tutorial/tour-of-heroes/toh-pt0.md +++ b/aio/content/tutorial/tour-of-heroes/toh-pt0.md @@ -152,4 +152,4 @@ Here are the code files discussed on this page. * You learned that Angular components display data * You used the double curly braces of interpolation to display the application title -@reviewed 2022-02-28 +@reviewed 2023-08-30