diff --git a/adev/src/content/api-examples/router/testing/test/router_testing_harness_examples.spec.ts b/adev/src/content/api-examples/router/testing/test/router_testing_harness_examples.spec.ts index 309ec85e091cd..39c282bf0ec1a 100644 --- a/adev/src/content/api-examples/router/testing/test/router_testing_harness_examples.spec.ts +++ b/adev/src/content/api-examples/router/testing/test/router_testing_harness_examples.spec.ts @@ -15,7 +15,7 @@ import {RouterTestingHarness} from '@angular/router/testing'; describe('navigate for test examples', () => { // #docregion RoutedComponent it('navigates to routed component', async () => { - @Component({standalone: true, template: 'hello {{name}}'}) + @Component({template: 'hello {{name}}'}) class TestCmp { name = 'world'; } @@ -32,9 +32,9 @@ describe('navigate for test examples', () => { // #enddocregion it('testing a guard', async () => { - @Component({standalone: true, template: ''}) + @Component({template: ''}) class AdminComponent {} - @Component({standalone: true, template: ''}) + @Component({template: ''}) class LoginComponent {} // #docregion Guard diff --git a/adev/src/content/best-practices/style-guide.md b/adev/src/content/best-practices/style-guide.md index 4d80ceaf410bf..1848994579938 100644 --- a/adev/src/content/best-practices/style-guide.md +++ b/adev/src/content/best-practices/style-guide.md @@ -293,8 +293,8 @@ Provides a consistent way to quickly identify and reference pipes. | Symbol name | File name | |:--- |:--- | -| @Pipe({ standalone: true, name: 'ellipsis' })
export class EllipsisPipe implements PipeTransform { }
| ellipsis.pipe.ts | -| @Pipe({ standalone: true, name: 'initCaps' })
export class InitCapsPipe implements PipeTransform { }
| init-caps.pipe.ts | +| @Pipe({ name: 'ellipsis' })
export class EllipsisPipe implements PipeTransform { }
| ellipsis.pipe.ts | +| @Pipe({ name: 'initCaps' })
export class InitCapsPipe implements PipeTransform { }
| init-caps.pipe.ts | ### Unit test file names diff --git a/adev/src/content/examples/accessibility/src/app/app.component.ts b/adev/src/content/examples/accessibility/src/app/app.component.ts index 2d7cf55c7071b..292783fc0e952 100755 --- a/adev/src/content/examples/accessibility/src/app/app.component.ts +++ b/adev/src/content/examples/accessibility/src/app/app.component.ts @@ -2,7 +2,6 @@ import {Component} from '@angular/core'; import {ExampleProgressbarComponent} from './progress-bar.component'; @Component({ - standalone: true, selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], diff --git a/adev/src/content/examples/accessibility/src/app/progress-bar.component.ts b/adev/src/content/examples/accessibility/src/app/progress-bar.component.ts index a135654080ddd..deaea6d5c74d4 100755 --- a/adev/src/content/examples/accessibility/src/app/progress-bar.component.ts +++ b/adev/src/content/examples/accessibility/src/app/progress-bar.component.ts @@ -6,7 +6,6 @@ import {Component, Input} from '@angular/core'; * Example progressbar component. */ @Component({ - standalone: true, selector: 'app-example-progressbar', template: '
', styleUrls: ['./progress-bar.component.css'], diff --git a/adev/src/content/examples/angular-compiler-options/src/app/app.component.ts b/adev/src/content/examples/angular-compiler-options/src/app/app.component.ts index d2e081e6e4de5..e0309856e8760 100644 --- a/adev/src/content/examples/angular-compiler-options/src/app/app.component.ts +++ b/adev/src/content/examples/angular-compiler-options/src/app/app.component.ts @@ -1,7 +1,6 @@ import {Component} from '@angular/core'; @Component({ - standalone: true, selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], diff --git a/adev/src/content/examples/animations/src/app/about.component.ts b/adev/src/content/examples/animations/src/app/about.component.ts index 209cd8b37306e..43f171e65c05d 100755 --- a/adev/src/content/examples/animations/src/app/about.component.ts +++ b/adev/src/content/examples/animations/src/app/about.component.ts @@ -1,7 +1,6 @@ import {Component} from '@angular/core'; @Component({ - standalone: true, selector: 'app-about', templateUrl: './about.component.html', styleUrls: ['./about.component.css'], diff --git a/adev/src/content/examples/animations/src/app/app.component.ts b/adev/src/content/examples/animations/src/app/app.component.ts index a222b280f7e04..b7dd0efe90094 100755 --- a/adev/src/content/examples/animations/src/app/app.component.ts +++ b/adev/src/content/examples/animations/src/app/app.component.ts @@ -16,7 +16,6 @@ import {slideInAnimation} from './animations'; // #docregion decorator, toggle-app-animations, define @Component({ - standalone: true, selector: 'app-root', templateUrl: 'app.component.html', styleUrls: ['app.component.css'], diff --git a/adev/src/content/examples/animations/src/app/hero-list-auto-page.component.ts b/adev/src/content/examples/animations/src/app/hero-list-auto-page.component.ts index 9506f826cf06c..351a092a8ade2 100755 --- a/adev/src/content/examples/animations/src/app/hero-list-auto-page.component.ts +++ b/adev/src/content/examples/animations/src/app/hero-list-auto-page.component.ts @@ -3,7 +3,6 @@ import {HEROES} from './mock-heroes'; import {HeroListAutoComponent} from './hero-list-auto.component'; @Component({ - standalone: true, selector: 'app-hero-list-auto-page', template: `
diff --git a/adev/src/content/examples/animations/src/app/hero-list-auto.component.ts b/adev/src/content/examples/animations/src/app/hero-list-auto.component.ts index 28812a01c2be5..f2454e2c39c24 100755 --- a/adev/src/content/examples/animations/src/app/hero-list-auto.component.ts +++ b/adev/src/content/examples/animations/src/app/hero-list-auto.component.ts @@ -5,7 +5,6 @@ import {Hero} from './hero'; import {NgFor} from '@angular/common'; @Component({ - standalone: true, selector: 'app-hero-list-auto', templateUrl: 'hero-list-auto.component.html', styleUrls: ['./hero-list-page.component.css'], diff --git a/adev/src/content/examples/animations/src/app/hero-list-enter-leave-page.component.ts b/adev/src/content/examples/animations/src/app/hero-list-enter-leave-page.component.ts index 6a3d4d349efb7..4ec12d92982fb 100755 --- a/adev/src/content/examples/animations/src/app/hero-list-enter-leave-page.component.ts +++ b/adev/src/content/examples/animations/src/app/hero-list-enter-leave-page.component.ts @@ -3,7 +3,6 @@ import {HEROES} from './mock-heroes'; import {HeroListEnterLeaveComponent} from './hero-list-enter-leave.component'; @Component({ - standalone: true, selector: 'app-hero-list-enter-leave-page', template: `
diff --git a/adev/src/content/examples/animations/src/app/hero-list-enter-leave.component.ts b/adev/src/content/examples/animations/src/app/hero-list-enter-leave.component.ts index 8609c0eec8d8c..6a3df81e006f5 100755 --- a/adev/src/content/examples/animations/src/app/hero-list-enter-leave.component.ts +++ b/adev/src/content/examples/animations/src/app/hero-list-enter-leave.component.ts @@ -5,7 +5,6 @@ import {Hero} from './hero'; import {NgFor} from '@angular/common'; @Component({ - standalone: true, selector: 'app-hero-list-enter-leave', template: ` `, - standalone: true, }) export class CommentsComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/README.md b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/README.md index baa59de496569..526fb8b993f00 100644 --- a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/README.md +++ b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/README.md @@ -16,7 +16,6 @@ In order to leverage the `NgOptimizedImage` directive, first import it from the import { NgOptimizedImage } from '@angular/common'; @Component({ - standalone: true, imports: [NgOptimizedImage], ... }) @@ -32,7 +31,6 @@ To enable the `NgOptimizedImage` directive, swap out the `src` attribute for `ng import { NgOptimizedImage } from '@angular/common'; @Component({ - standalone: true, template: ` ...
  • diff --git a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/app.component.ts index e175b5e2dae1f..eb3f15f9917af 100644 --- a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/app.component.ts @@ -6,7 +6,6 @@ import {UserComponent} from './user.component'; template: ` `, - standalone: true, imports: [UserComponent], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/user.component.ts index 0de1633ef8b91..9ec7e6cd7304d 100644 --- a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/answer/src/app/user.component.ts @@ -2,7 +2,6 @@ import {Component} from '@angular/core'; import {NgOptimizedImage} from '@angular/common'; @Component({ - standalone: true, selector: 'app-user', template: `

    Username: {{ username }}

    diff --git a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/app.component.ts index e175b5e2dae1f..eb3f15f9917af 100644 --- a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/app.component.ts @@ -6,7 +6,6 @@ import {UserComponent} from './user.component'; template: ` `, - standalone: true, imports: [UserComponent], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/user.component.ts index 914e9d56f4bed..240cde9531f62 100644 --- a/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/11-optimizing-images/src/app/user.component.ts @@ -1,7 +1,6 @@ import {Component} from '@angular/core'; @Component({ - standalone: true, selector: 'app-user', template: `

    Username: {{ username }}

    diff --git a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/README.md b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/README.md index 71c3183d042c9..927bb72dad0dd 100644 --- a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/README.md +++ b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/README.md @@ -62,7 +62,6 @@ import {RouterOutlet} from '@angular/router'; `, - standalone: true, imports: [RouterOutlet], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/app.component.ts index 452d0c6702e52..e6797ef04e48e 100644 --- a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/app.component.ts @@ -11,7 +11,6 @@ import {RouterOutlet} from '@angular/router'; `, - standalone: true, imports: [RouterOutlet], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/home/home.component.ts b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/home/home.component.ts index 70c2f67ef7199..58543721aef0c 100644 --- a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/home/home.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/home/home.component.ts @@ -5,6 +5,5 @@ import {Component} from '@angular/core'; template: `
    Home Page
    `, - standalone: true, }) export class HomeComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/user/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/user/user.component.ts index b30ccd761cf8d..4540dca47572b 100644 --- a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/user/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/user/user.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: `
    Username: {{ username }}
    `, - standalone: true, }) export class UserComponent { username = 'youngTech'; diff --git a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/app.component.ts index 12b1a18d9e7a7..7c14e0df2ec0f 100644 --- a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/app.component.ts @@ -10,7 +10,6 @@ import {RouterOutlet} from '@angular/router'; User `, - standalone: true, imports: [RouterOutlet], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/home/home.component.ts b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/home/home.component.ts index 70c2f67ef7199..58543721aef0c 100644 --- a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/home/home.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/home/home.component.ts @@ -5,6 +5,5 @@ import {Component} from '@angular/core'; template: `
    Home Page
    `, - standalone: true, }) export class HomeComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/user/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/user/user.component.ts index b30ccd761cf8d..4540dca47572b 100644 --- a/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/user/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/12-enable-routing/src/app/user/user.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: `
    Username: {{ username }}
    `, - standalone: true, }) export class UserComponent { username = 'youngTech'; diff --git a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/app.component.ts index 9855903cf438c..8f67e3cd21f10 100644 --- a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/app.component.ts @@ -11,7 +11,6 @@ import {RouterOutlet} from '@angular/router'; `, - standalone: true, imports: [RouterOutlet], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/home/home.component.ts b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/home/home.component.ts index 70c2f67ef7199..58543721aef0c 100644 --- a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/home/home.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/home/home.component.ts @@ -5,6 +5,5 @@ import {Component} from '@angular/core'; template: `
    Home Page
    `, - standalone: true, }) export class HomeComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/user/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/user/user.component.ts index b30ccd761cf8d..4540dca47572b 100644 --- a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/user/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/answer/src/app/user/user.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: `
    Username: {{ username }}
    `, - standalone: true, }) export class UserComponent { username = 'youngTech'; diff --git a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/app.component.ts index 9855903cf438c..8f67e3cd21f10 100644 --- a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/app.component.ts @@ -11,7 +11,6 @@ import {RouterOutlet} from '@angular/router'; `, - standalone: true, imports: [RouterOutlet], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/home/home.component.ts b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/home/home.component.ts index 70c2f67ef7199..58543721aef0c 100644 --- a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/home/home.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/home/home.component.ts @@ -5,6 +5,5 @@ import {Component} from '@angular/core'; template: `
    Home Page
    `, - standalone: true, }) export class HomeComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/user/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/user/user.component.ts index b30ccd761cf8d..4540dca47572b 100644 --- a/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/user/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/13-define-a-route/src/app/user/user.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: `
    Username: {{ username }}
    `, - standalone: true, }) export class UserComponent { username = 'youngTech'; diff --git a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/README.md b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/README.md index 813ca3bc30300..f01ad405ecabb 100644 --- a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/README.md +++ b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/README.md @@ -17,7 +17,6 @@ In `app.component.ts` add the `RouterLink` directive import to the existing impo import { RouterLink, RouterOutlet } from '@angular/router'; @Component({ - standalone: true, imports: [RouterLink, RouterOutlet], ... }) @@ -34,7 +33,6 @@ import { RouterLink, RouterOutlet } from '@angular/router'; @Component({ ... - standalone: true, template: ` ... Home diff --git a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/app.component.ts index 98b0e60ab5b1a..88b6b4d201202 100644 --- a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/app.component.ts @@ -11,7 +11,6 @@ import {RouterOutlet, RouterLink} from '@angular/router'; `, - standalone: true, imports: [RouterOutlet, RouterLink], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/home/home.component.ts b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/home/home.component.ts index 70c2f67ef7199..58543721aef0c 100644 --- a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/home/home.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/home/home.component.ts @@ -5,6 +5,5 @@ import {Component} from '@angular/core'; template: `
    Home Page
    `, - standalone: true, }) export class HomeComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/user/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/user/user.component.ts index b30ccd761cf8d..4540dca47572b 100644 --- a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/user/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/answer/src/app/user/user.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: `
    Username: {{ username }}
    `, - standalone: true, }) export class UserComponent { username = 'youngTech'; diff --git a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/app.component.ts index 452d0c6702e52..e6797ef04e48e 100644 --- a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/app.component.ts @@ -11,7 +11,6 @@ import {RouterOutlet} from '@angular/router'; `, - standalone: true, imports: [RouterOutlet], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/home/home.component.ts b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/home/home.component.ts index 70c2f67ef7199..58543721aef0c 100644 --- a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/home/home.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/home/home.component.ts @@ -5,6 +5,5 @@ import {Component} from '@angular/core'; template: `
    Home Page
    `, - standalone: true, }) export class HomeComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/user/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/user/user.component.ts index b30ccd761cf8d..4540dca47572b 100644 --- a/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/user/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/14-routerLink/src/app/user/user.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: `
    Username: {{ username }}
    `, - standalone: true, }) export class UserComponent { username = 'youngTech'; diff --git a/adev/src/content/tutorials/learn-angular/steps/15-forms/README.md b/adev/src/content/tutorials/learn-angular/steps/15-forms/README.md index 0fafc8c5e8987..08dbb5bc96143 100644 --- a/adev/src/content/tutorials/learn-angular/steps/15-forms/README.md +++ b/adev/src/content/tutorials/learn-angular/steps/15-forms/README.md @@ -35,7 +35,6 @@ import {FormsModule} from '@angular/forms'; @Component({ ... - standalone: true, imports: [FormsModule], }) export class UserComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/app.component.ts index abadda34f9c5c..eb3f15f9917af 100644 --- a/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/app.component.ts @@ -2,7 +2,6 @@ import {Component} from '@angular/core'; import {UserComponent} from './user.component'; @Component({ - standalone: true, selector: 'app-root', template: ` diff --git a/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/user.component.ts index 1ef54d11a690a..bfd805d3453e6 100644 --- a/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/15-forms/answer/src/app/user.component.ts @@ -11,7 +11,6 @@ import {FormsModule} from '@angular/forms'; `, - standalone: true, imports: [FormsModule], }) export class UserComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/app.component.ts index abadda34f9c5c..eb3f15f9917af 100644 --- a/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/app.component.ts @@ -2,7 +2,6 @@ import {Component} from '@angular/core'; import {UserComponent} from './user.component'; @Component({ - standalone: true, selector: 'app-root', template: ` diff --git a/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/user.component.ts index 5fd3bfd97489f..161d91fd05297 100644 --- a/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/15-forms/src/app/user.component.ts @@ -7,7 +7,6 @@ import {Component} from '@angular/core';

    {{ username }}'s favorite framework: {{ favoriteFramework }}

    `, - standalone: true, imports: [], }) export class UserComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/app.component.ts index e175b5e2dae1f..eb3f15f9917af 100644 --- a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/app.component.ts @@ -6,7 +6,6 @@ import {UserComponent} from './user.component'; template: ` `, - standalone: true, imports: [UserComponent], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/user.component.ts index 33286e48430df..b32e533628628 100644 --- a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/answer/src/app/user.component.ts @@ -12,7 +12,6 @@ import {FormsModule} from '@angular/forms'; `, - standalone: true, imports: [FormsModule], }) export class UserComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/app.component.ts index e175b5e2dae1f..eb3f15f9917af 100644 --- a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/app.component.ts @@ -6,7 +6,6 @@ import {UserComponent} from './user.component'; template: ` `, - standalone: true, imports: [UserComponent], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/user.component.ts index 4c02aa1915d13..a96361dc27e2f 100644 --- a/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/16-form-control-values/src/app/user.component.ts @@ -12,7 +12,6 @@ import {FormsModule} from '@angular/forms'; `, - standalone: true, imports: [FormsModule], }) export class UserComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/17-reactive-forms/README.md b/adev/src/content/tutorials/learn-angular/steps/17-reactive-forms/README.md index a44d5bce7b6c6..c257767e06e57 100644 --- a/adev/src/content/tutorials/learn-angular/steps/17-reactive-forms/README.md +++ b/adev/src/content/tutorials/learn-angular/steps/17-reactive-forms/README.md @@ -17,7 +17,6 @@ import { ReactiveFormsModule } from '@angular/forms'; @Component({ selector: 'app-root', - standalone: true, template: `
  • Currency with "currency" {{ cost | currency }}
  • `, - standalone: true, imports: [DecimalPipe, DatePipe, CurrencyPipe], }) export class AppComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/23-pipes-format-data/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/23-pipes-format-data/src/app/app.component.ts index c8ad19ff0c29c..7381174f53176 100644 --- a/adev/src/content/tutorials/learn-angular/steps/23-pipes-format-data/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/23-pipes-format-data/src/app/app.component.ts @@ -10,7 +10,6 @@ import {DecimalPipe, DatePipe, CurrencyPipe} from '@angular/common';
  • Currency with "currency" {{ cost }}
  • `, - standalone: true, imports: [DecimalPipe, DatePipe, CurrencyPipe], }) export class AppComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/README.md b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/README.md index d56674d4e558d..601f6460b6a22 100644 --- a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/README.md +++ b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/README.md @@ -12,7 +12,6 @@ A pipe is a TypeScript class with a `@Pipe` decorator. Here's an example: import {Pipe, PipeTransform} from '@angular/core'; @Pipe({ - standalone: true, name: 'star', }) export class StarPipe implements PipeTransform { @@ -37,7 +36,6 @@ In `reverse.pipe.ts` add the `@Pipe` decorator to the `ReversePipe` class and pr ```ts @Pipe({ - standalone: true, name: 'reverse' }) ``` diff --git a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/app.component.ts index 549808485e7b1..208c6f8d405bb 100644 --- a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/app.component.ts @@ -6,7 +6,6 @@ import {ReversePipe} from './reverse.pipe'; template: ` Reverse Machine: {{ word | reverse }} `, - standalone: true, imports: [ReversePipe], }) export class AppComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/reverse.pipe.ts b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/reverse.pipe.ts index 4e67749d4f9a7..d0d95cdca6966 100644 --- a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/reverse.pipe.ts +++ b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/answer/src/app/reverse.pipe.ts @@ -2,7 +2,6 @@ import {Pipe, PipeTransform} from '@angular/core'; @Pipe({ name: 'reverse', - standalone: true, }) export class ReversePipe implements PipeTransform { transform(value: string): string { diff --git a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/src/app/app.component.ts index 56e8a4f5e3c62..71c0870cc94ae 100644 --- a/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/24-create-a-pipe/src/app/app.component.ts @@ -6,7 +6,6 @@ import {ReversePipe} from './reverse.pipe'; template: ` Reverse Machine: {{ word }} `, - standalone: true, imports: [], }) export class AppComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/3-composing-components/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/3-composing-components/answer/src/app/app.component.ts index ede017f50ad7d..cfcf11d2e2f32 100644 --- a/adev/src/content/tutorials/learn-angular/steps/3-composing-components/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/3-composing-components/answer/src/app/app.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: ` Username: {{ username }} `, - standalone: true, }) export class UserComponent { username = 'youngTech'; @@ -18,7 +17,6 @@ export class UserComponent {
    `, - standalone: true, imports: [UserComponent], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/3-composing-components/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/3-composing-components/src/app/app.component.ts index c6522c11c1c5d..48a7c83cc3b78 100644 --- a/adev/src/content/tutorials/learn-angular/steps/3-composing-components/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/3-composing-components/src/app/app.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: ` Username: {{ username }} `, - standalone: true, }) export class UserComponent { username = 'youngTech'; @@ -14,7 +13,6 @@ export class UserComponent { @Component({ selector: 'app-root', template: ``, - standalone: true, imports: [], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/answer/src/app/app.component.ts index 4ce82eb32b0bc..1eeba7adc4d46 100644 --- a/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/answer/src/app/app.component.ts @@ -9,7 +9,6 @@ import {Component} from '@angular/core'; No, the server is not running } `, - standalone: true, }) export class AppComponent { isServerRunning = true; diff --git a/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/src/app/app.component.ts index 4df46536990de..1b55a78f50159 100644 --- a/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/4-control-flow-if/src/app/app.component.ts @@ -5,7 +5,6 @@ import {Component} from '@angular/core'; template: ` Yes, the server is running `, - standalone: true, }) export class AppComponent { // add the boolean property here diff --git a/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/answer/src/app/app.component.ts index 402f493d90989..4c2de7dece69e 100644 --- a/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/answer/src/app/app.component.ts @@ -7,7 +7,6 @@ import {Component} from '@angular/core';

    {{ user.name }}

    } `, - standalone: true, }) export class AppComponent { users = [ diff --git a/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/src/app/app.component.ts index 4c4fbc4cc7340..9db390f3a4862 100644 --- a/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/5-control-flow-for/src/app/app.component.ts @@ -3,6 +3,5 @@ import {Component} from '@angular/core'; @Component({ selector: 'app-root', template: ``, - standalone: true, }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/6-property-binding/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/6-property-binding/answer/src/app/app.component.ts index 49a2938af7537..a4b37d26a4a67 100644 --- a/adev/src/content/tutorials/learn-angular/steps/6-property-binding/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/6-property-binding/answer/src/app/app.component.ts @@ -6,7 +6,6 @@ import {Component} from '@angular/core'; template: `
    `, - standalone: true, }) export class AppComponent { isEditable = true; diff --git a/adev/src/content/tutorials/learn-angular/steps/6-property-binding/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/6-property-binding/src/app/app.component.ts index 5713a3cc89d6c..b229abc83eb4d 100644 --- a/adev/src/content/tutorials/learn-angular/steps/6-property-binding/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/6-property-binding/src/app/app.component.ts @@ -6,6 +6,5 @@ import {Component} from '@angular/core'; template: `
    `, - standalone: true, }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/7-event-handling/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/7-event-handling/answer/src/app/app.component.ts index d9f1a772db75a..97b5579c78ac1 100644 --- a/adev/src/content/tutorials/learn-angular/steps/7-event-handling/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/7-event-handling/answer/src/app/app.component.ts @@ -8,7 +8,6 @@ import {Component} from '@angular/core'; {{ message }}
    `, - standalone: true, }) export class AppComponent { message = ''; diff --git a/adev/src/content/tutorials/learn-angular/steps/7-event-handling/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/7-event-handling/src/app/app.component.ts index c55ba45ed6d65..b446419af7814 100644 --- a/adev/src/content/tutorials/learn-angular/steps/7-event-handling/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/7-event-handling/src/app/app.component.ts @@ -8,7 +8,6 @@ import {Component} from '@angular/core'; {{ message }} `, - standalone: true, }) export class AppComponent { message = ''; diff --git a/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/app.component.ts index 13011f30f13ea..c89378aff2bda 100644 --- a/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/app.component.ts @@ -6,7 +6,6 @@ import {UserComponent} from './user.component'; template: ` `, - standalone: true, imports: [UserComponent], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/user.component.ts index e42b68e92665c..25e0cb6304976 100644 --- a/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/8-input/answer/src/app/user.component.ts @@ -5,7 +5,6 @@ import {Component, Input} from '@angular/core'; template: `

    The user's name is {{ name }}

    `, - standalone: true, }) export class UserComponent { @Input() name = ''; diff --git a/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/app.component.ts index e175b5e2dae1f..eb3f15f9917af 100644 --- a/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/app.component.ts @@ -6,7 +6,6 @@ import {UserComponent} from './user.component'; template: ` `, - standalone: true, imports: [UserComponent], }) export class AppComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/user.component.ts b/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/user.component.ts index f39252ae32c3e..23a907db53824 100644 --- a/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/user.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/8-input/src/app/user.component.ts @@ -5,6 +5,5 @@ import {Component, Input} from '@angular/core'; template: `

    The user's name is

    `, - standalone: true, }) export class UserComponent {} diff --git a/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/app.component.ts index 4dfff1bc7db5c..ce34e950fa788 100644 --- a/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/app.component.ts @@ -7,7 +7,6 @@ import {ChildComponent} from './child.component';

    🐢 all the way down {{ items.length }}

    `, - standalone: true, imports: [ChildComponent], }) export class AppComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/child.component.ts b/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/child.component.ts index 5f46a559f9efd..5a3d1657ef539 100644 --- a/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/child.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/9-output/answer/src/app/child.component.ts @@ -6,7 +6,6 @@ import {Component, Output, EventEmitter} from '@angular/core'; template: ` `, - standalone: true, }) export class ChildComponent { @Output() addItemEvent = new EventEmitter(); diff --git a/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/app.component.ts b/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/app.component.ts index 67d1564f201be..bab5214353267 100644 --- a/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/app.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/app.component.ts @@ -7,7 +7,6 @@ import {ChildComponent} from './child.component';

    🐢 all the way down {{ items.length }}

    `, - standalone: true, imports: [ChildComponent], }) export class AppComponent { diff --git a/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/child.component.ts b/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/child.component.ts index f7364e6ee3650..e282c70cb7e30 100644 --- a/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/child.component.ts +++ b/adev/src/content/tutorials/learn-angular/steps/9-output/src/app/child.component.ts @@ -6,7 +6,6 @@ import {Component, Output, EventEmitter} from '@angular/core'; template: ` `, - standalone: true, }) export class ChildComponent { addItem() {} diff --git a/adev/src/content/tutorials/playground/0-hello-world/src/main.ts b/adev/src/content/tutorials/playground/0-hello-world/src/main.ts index 4faf227ff19f1..e6a992d40a920 100644 --- a/adev/src/content/tutorials/playground/0-hello-world/src/main.ts +++ b/adev/src/content/tutorials/playground/0-hello-world/src/main.ts @@ -3,7 +3,6 @@ import {bootstrapApplication} from '@angular/platform-browser'; @Component({ selector: 'app-root', - standalone: true, template: ` Hello world! `, diff --git a/adev/src/content/tutorials/playground/1-signals/src/main.ts b/adev/src/content/tutorials/playground/1-signals/src/main.ts index cd5e17cbfdac1..be49eef0df6f0 100644 --- a/adev/src/content/tutorials/playground/1-signals/src/main.ts +++ b/adev/src/content/tutorials/playground/1-signals/src/main.ts @@ -3,7 +3,6 @@ import {bootstrapApplication} from '@angular/platform-browser'; @Component({ selector: 'app-root', - standalone: true, template: `

    Cookie recipe

    diff --git a/adev/src/content/tutorials/playground/2-control-flow/src/main.ts b/adev/src/content/tutorials/playground/2-control-flow/src/main.ts index 70eb63c526a4d..29e0c5d36b6ad 100644 --- a/adev/src/content/tutorials/playground/2-control-flow/src/main.ts +++ b/adev/src/content/tutorials/playground/2-control-flow/src/main.ts @@ -3,7 +3,6 @@ import {bootstrapApplication} from '@angular/platform-browser'; @Component({ selector: 'app-root', - standalone: true, template: `

    Todos

    diff --git a/adev/src/content/tutorials/playground/3-minigame/src/main.ts b/adev/src/content/tutorials/playground/3-minigame/src/main.ts index ebe081212e4be..17a1d229cffa8 100644 --- a/adev/src/content/tutorials/playground/3-minigame/src/main.ts +++ b/adev/src/content/tutorials/playground/3-minigame/src/main.ts @@ -52,7 +52,6 @@ function getResultQuote(accuracy: number) { @Component({ selector: 'app-root', - standalone: true, imports: [CommonModule, MatSlideToggleModule, A11yModule], styleUrl: 'game.css', templateUrl: 'game.html', diff --git a/goldens/public-api/core/index.api.md b/goldens/public-api/core/index.api.md index 057fe9a5c8f06..12f0955403786 100644 --- a/goldens/public-api/core/index.api.md +++ b/goldens/public-api/core/index.api.md @@ -1562,6 +1562,12 @@ export interface RendererType2 { styles: string[]; } +// @public +export const REQUEST: InjectionToken; + +// @public +export const REQUEST_CONTEXT: InjectionToken; + // @public export function resolveForwardRef(type: T): T; @@ -1618,6 +1624,9 @@ export enum ResourceStatus { Resolved = 4 } +// @public +export const RESPONSE_INIT: InjectionToken; + // @public export function runInInjectionContext(injector: Injector, fn: () => ReturnT): ReturnT; diff --git a/packages/core/src/application/platform_tokens.ts b/packages/core/src/application/platform_tokens.ts new file mode 100644 index 0000000000000..268cb162fc662 --- /dev/null +++ b/packages/core/src/application/platform_tokens.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import {InjectionToken} from '../di/injection_token'; + +/** + * Injection token representing the current HTTP request object. + * + * Use this token to access the current request when handling server-side + * rendering (SSR). + * + * @remarks + * This token may be `null` in the following scenarios: + * + * * During the build processes. + * * When the application is rendered in the browser (client-side rendering). + * * When performing static site generation (SSG). + * * During route extraction in development (at the time of the request). + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request | `Request` on MDN} + * + * @developerPreview + */ +export const REQUEST = new InjectionToken('REQUEST', { + providedIn: 'platform', + factory: () => null, +}); + +/** + * Injection token for response initialization options. + * + * Use this token to provide response options for configuring or initializing + * HTTP responses in server-side rendering or API endpoints. + * + * @remarks + * This token may be `null` in the following scenarios: + * + * * During the build processes. + * * When the application is rendered in the browser (client-side rendering). + * * When performing static site generation (SSG). + * * During route extraction in development (at the time of the request). + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response | `ResponseInit` on MDN} + * + * @developerPreview + */ +export const RESPONSE_INIT = new InjectionToken('RESPONSE_INIT', { + providedIn: 'platform', + factory: () => null, +}); + +/** + * Injection token for additional request context. + * + * Use this token to pass custom metadata or context related to the current request in server-side rendering. + * + * @remarks + * This token is only available during server-side rendering and will be `null` in other contexts. + * + * @developerPreview + */ +export const REQUEST_CONTEXT = new InjectionToken('REQUEST_CONTEXT', { + providedIn: 'platform', + factory: () => null, +}); diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index abc81954782fe..685f51cb7c68e 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -115,6 +115,7 @@ export { export {ApplicationConfig, mergeApplicationConfig} from './application/application_config'; export {makeStateKey, StateKey, TransferState} from './transfer_state'; export {booleanAttribute, numberAttribute} from './util/coercion'; +export {REQUEST, RESPONSE_INIT, REQUEST_CONTEXT} from './application/platform_tokens'; import {global} from './util/global'; if (typeof ngDevMode !== 'undefined' && ngDevMode) {