mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
d0b95d5877
This addresses the offset issue caused when a switch case was empty with no spaces or children being affected by the markers that were added, but not accounted for in offset. The markers are not needed for empty content and can be safely removed in this case. fixes: #53779 PR Close #53839
Control Flow Syntax migration
Angular v17 introduces a new control flow syntax. This migration replaces the
existing usages of *ngIf, *ngFor, and *ngSwitch to their equivalent block
syntax. Existing ng-templates are preserved in case they are used elsewhere in
the template. It has the following option:
path- Relative path within the project that the migration should apply to. Can be used to migrate specific sub-directories individually. Defaults to the project root.
NOTE: This is a developer preview migration
Before
import {Component} from '@angular/core';
@Component({
template: `<div><span *ngIf="show">Content here</span></div>`
})
export class MyComp {
show = false;
}
After
import {Component} from '@angular/core';
@Component({
template: `<div>@if (show) {<span>Content here</span>}</div>`
})
export class MyComp {
show = false
}