Skip to content

Commit 15c5dcc

Browse files
committed
feat(): new control flow and default standalone
1 parent f44c3f1 commit 15c5dcc

30 files changed

Lines changed: 55 additions & 185 deletions

File tree

apps/angular/1-projection/src/app/ui/list-item/list-item.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { CardType } from '../../model/card.model';
1818
</button>
1919
</div>
2020
`,
21-
standalone: true,
2221
changeDetection: ChangeDetectionStrategy.OnPush,
2322
})
2423
export class ListItemComponent {

apps/angular/16-master-dependency-injection/src/app/app.component.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TableComponent } from '@angular-challenges/shared/ui';
2-
import { AsyncPipe, NgFor } from '@angular/common';
3-
import { Component, Directive } from '@angular/core';
2+
import { AsyncPipe } from '@angular/common';
3+
import { ChangeDetectionStrategy, Component, Directive } from '@angular/core';
44
import { CurrencyPipe } from './currency.pipe';
55
import { CurrencyService } from './currency.service';
66
import { Product, products } from './product.model';
@@ -11,7 +11,6 @@ interface ProductContext {
1111

1212
@Directive({
1313
selector: 'ng-template[product]',
14-
standalone: true,
1514
})
1615
export class ProductDirective {
1716
static ngTemplateContextGuard(
@@ -23,16 +22,18 @@ export class ProductDirective {
2322
}
2423

2524
@Component({
26-
imports: [TableComponent, CurrencyPipe, AsyncPipe, NgFor, ProductDirective],
25+
imports: [TableComponent, CurrencyPipe, AsyncPipe, ProductDirective],
2726
providers: [CurrencyService],
2827
selector: 'app-root',
2928
template: `
3029
<table [items]="products">
3130
<ng-template #header>
3231
<tr>
33-
<th *ngFor="let col of displayedColumns">
34-
{{ col }}
35-
</th>
32+
@for (col of displayedColumns; track $index) {
33+
<th>
34+
{{ col }}
35+
</th>
36+
}
3637
</tr>
3738
</ng-template>
3839
<ng-template #body product let-product>
@@ -45,6 +46,7 @@ export class ProductDirective {
4546
</ng-template>
4647
</table>
4748
`,
49+
changeDetection: ChangeDetectionStrategy.OnPush,
4850
})
4951
export class AppComponent {
5052
products = products;

apps/angular/16-master-dependency-injection/src/app/currency.pipe.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CurrencyService } from './currency.service';
44

55
@Pipe({
66
name: 'currency',
7-
standalone: true,
87
})
98
export class CurrencyPipe implements PipeTransform {
109
currencyService = inject(CurrencyService);

apps/angular/32-change-detection-bug/src/app/bar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component } from '@angular/core';
2+
23
@Component({
34
selector: 'app-bar',
4-
standalone: true,
55
template: `
66
BarComponent
77
`,

apps/angular/32-change-detection-bug/src/app/foo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component } from '@angular/core';
2+
23
@Component({
34
selector: 'app-foo',
4-
standalone: true,
55
template: `
66
Foo Component
77
`,

apps/angular/39-injection-token/src/app/timer.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { DEFAULT_TIMER } from './data';
55

66
@Component({
77
selector: 'timer',
8-
standalone: true,
98
template: `
109
Timer running {{ timer() }}
1110
`,

apps/angular/45-react-in-angular/src/app/react/post.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Component, EventEmitter, input, Output } from '@angular/core';
33
type Post = { title: string; description: string; pictureLink: string };
44

55
@Component({
6-
standalone: true,
76
selector: 'app-post',
87
template: `
98
<div></div>

apps/angular/6-structural-directive/src/app/dashboard/manager.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import { ChangeDetectionStrategy, Component } from '@angular/core';
2-
import { RouterLink } from '@angular/router';
3-
import { ButtonComponent } from '../button.component';
42

53
@Component({
64
selector: 'app-dashboard',
7-
standalone: true,
8-
imports: [RouterLink, ButtonComponent],
5+
imports: [],
96
template: `
107
<p>dashboard for Manager works!</p>
118
<button app-button routerLink="/">Logout</button>

apps/forms/41-control-value-accessor/src/app/rating-control/rating-control.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Component, EventEmitter, Output } from '@angular/core';
22

33
@Component({
4-
standalone: true,
54
selector: 'app-rating-control',
65
templateUrl: 'rating-control.component.html',
76
styleUrls: ['rating-control.component.scss'],

apps/forms/48-avoid-losing-form-data/src/app/pages/page.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
22

33
@Component({
4-
standalone: true,
54
template: `
65
<section>
76
<h1>{{ title() }}</h1>

0 commit comments

Comments
 (0)