docs: cleanup existing migration docs for consistency (#57421)

PR Close #57421
This commit is contained in:
Andrew Kushnir
2024-08-15 18:20:51 -07:00
committed by Dylan Hunn
parent c89be37193
commit c65ab136bf
4 changed files with 11 additions and 8 deletions
@@ -1,9 +1,10 @@
# Migration to Control Flow syntax
[Control flow syntax](guide/templates/control-flow) is available from Angular v17. The new syntax is baked into the template, so you don't need to import `CommonModule` anymore.
[Control flow syntax](guide/templates/control-flow) is available from Angular 17 and simplified way to use the control-flow directives like *ngFor, *ngIf and *ngSwitch.
This schematic migrates all existing code in your application to use new Control Flow Syntax.
The new syntax is baked into the template, so you don't need to import `CommonModule` anymore. But wait there is more to it, there is an migration available for migrating all your old code to use new Control Flow Syntax with Angular 17 release. Run the schematic with the following command:
Run the schematic using the following command:
<docs-code language="shell">
@@ -1,8 +1,10 @@
# Migration to the `inject` function
Angular's `inject` function offers more accurate types and better compatibility with standard
decorators, compared to constructor-based injection. You can convert your application to it by
running the following command:
Angular's `inject` function offers more accurate types and better compatibility with standard decorators, compared to constructor-based injection.
This schematic converts constructor-based injection in your classes to use the `inject` function instead.
Run the schematic using the following command:
<docs-code language="shell">
@@ -5,8 +5,6 @@ Learn about how you can migrate your existing angular project to the latest feat
<docs-card-container>
<docs-card title="Standalone" link="Migrate now" href="reference/migrations/standalone">
Standalone components provide a simplified way to build Angular applications. Standalone components specify their dependencies directly instead of getting them through NgModules.
Standalone components, directives, and pipes aim to streamline the authoring experience by reducing the need for NgModules.
</docs-card>
<docs-card title="Control Flow Syntax" link="Migrate now" href="reference/migrations/control-flow">
Control Flow Syntax is available with Angular 17 release and allows you to use more ergonomic syntax which is close to javascript, better type checking and lazy load part of the component. It replaces the need to imports CommonModule to use functionalities like `*ngFor`, `*ngIf`.
@@ -4,7 +4,9 @@
<docs-video src="https://www.youtube.com/embed/x5PZwb4XurU" title="Getting started with standalone components"/>
As of version 15.2.0, Angular offers a [schematic](tools/cli/schematics) to help project authors convert existing projects to the standalone APIs. The schematic aims to transform as much code as possible automatically, but it may require some manual fixes by the project author. Run the schematic with the following command:
This schematic helps to transform components, directive and pipes in existing projects to become standalone. The schematic aims to transform as much code as possible automatically, but it may require some manual fixes by the project author.
Run the schematic using the following command:
<docs-code language="shell">