Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions devtools/cypress/integration/view-component-metadata.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Viewing component metadata', () => {
});

it('should display change detection strategy', () => {
cy.contains('ng-component-metadata', 'Change Detection Strategy: Default');
cy.contains('ng-component-metadata', 'Change Detection Strategy: OnPush');
});
});

Expand All @@ -40,7 +40,7 @@ describe('Viewing component metadata', () => {
});

it('should display change detection strategy', () => {
cy.contains('ng-component-metadata', 'Change Detection Strategy: Default');
cy.contains('ng-component-metadata', 'Change Detection Strategy: OnPush');
});

it('should display correct set of inputs', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import {
} from '@angular/core';

import {
AngularDirectiveMetadata,
AcxDirectiveMetadata,
AngularDirectiveMetadata,
ComponentType,
} from '../../../../../../../../protocol';

import {ElementPropertyResolver} from '../../../property-resolver/element-property-resolver';
import {DocsRefButtonComponent} from '../../../../../shared/docs-ref-button/docs-ref-button.component';
import {ElementPropertyResolver} from '../../../property-resolver/element-property-resolver';

@Component({
selector: 'ng-component-metadata',
Expand Down Expand Up @@ -77,7 +77,7 @@ export class ComponentMetadataComponent {

const meta = metadata as Partial<AcxDirectiveMetadata | AngularDirectiveMetadata>;
if (meta.onPush !== undefined) {
return meta.onPush ? 'OnPush' : 'Default';
return meta.onPush ? 'OnPush' : 'Eager';
} else {
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {TestBed} from '@angular/core/testing';

import {GreetComponent} from './greet.component';
Expand Down Expand Up @@ -38,6 +38,7 @@ describe('greet component', () => {
/>
`,
imports: [GreetComponent],
changeDetection: ChangeDetectionStrategy.Eager,
})
class TestCmp {
clickCount = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Component} from '@angular/core';
import {ChangeDetectionStrategy, Component} from '@angular/core';

@Component({
selector: 'app-root',
template: '<router-outlet></router-outlet>',
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class AppComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
*/

import {HttpClient} from '@angular/common/http';
import {Component, OnInit} from '@angular/core';
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';

@Component({
selector: 'transfer-state-http-on-init',
template: ` <div class="one">{{ responseOne }}</div> `,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TransferStateComponentOnInit implements OnInit {
responseOne: string = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {HttpClient} from '@angular/common/http';
import {Component, OnInit} from '@angular/core';
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';

@Component({
selector: 'transfer-state-http',
Expand All @@ -16,6 +16,7 @@ import {Component, OnInit} from '@angular/core';
<div class="two">{{ responseTwo }}</div>
`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TransferStateComponent implements OnInit {
responseOne: string = '';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {Component} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {RouterOutlet} from '@angular/router';

@Component({
selector: 'app-root',

imports: [CommonModule, RouterOutlet],
template: '<router-outlet></router-outlet>',
changeDetection: ChangeDetectionStrategy.Eager,
})
export class AppComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
*/

import {HttpClient} from '@angular/common/http';
import {Component, OnInit} from '@angular/core';
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';

@Component({
selector: 'transfer-state-http',
standalone: true,
template: ` <div class="one">{{ responseOne }}</div> `,
providers: [HttpClient],
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TransferStateOnInitComponent implements OnInit {
responseOne: string = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {HttpClient} from '@angular/common/http';
import {Component, OnInit} from '@angular/core';
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';

@Component({
selector: 'transfer-state-http',
Expand All @@ -17,6 +17,7 @@ import {Component, OnInit} from '@angular/core';
<div class="two">{{ responseTwo }}</div>
`,
providers: [HttpClient],
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TransferStateComponent implements OnInit {
responseOne: string = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class InsertionComponent {
<insertion-component [template]="template" [viewCount]="viewCount"></insertion-component>
`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class DeclarationComponent {
@Input() viewCount = 1;
Expand Down
3 changes: 2 additions & 1 deletion modules/benchmarks/src/defer/baseline/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, Input} from '@angular/core';
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
import {DomSanitizer, SafeStyle} from '@angular/platform-browser';

import {TableCell} from '../util';
Expand Down Expand Up @@ -38,6 +38,7 @@ let trustedGreyColor: SafeStyle;
</tbody>
</table>
`,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class AppComponent {
@Input() data: TableCell[][] = [];
Expand Down
3 changes: 2 additions & 1 deletion modules/benchmarks/src/defer/main/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, Input} from '@angular/core';
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
import {DomSanitizer, SafeStyle} from '@angular/platform-browser';

import {TableCell} from '../util';
Expand Down Expand Up @@ -38,6 +38,7 @@ let trustedGreyColor: SafeStyle;
</tbody>
</table>
`,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class AppComponent {
@Input() data: TableCell[][] = [];
Expand Down
8 changes: 7 additions & 1 deletion modules/benchmarks/src/largeform/ng2/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, NgModule, provideZoneChangeDetection} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
NgModule,
provideZoneChangeDetection,
} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {BrowserModule} from '@angular/platform-browser';

Expand Down Expand Up @@ -65,6 +70,7 @@ import {BrowserModule} from '@angular/platform-browser';
<input type="text" [(ngModel)]="values[49]" name="value49" />
</form>`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class AppComponent {
copies: number[] = [];
Expand Down
3 changes: 2 additions & 1 deletion modules/benchmarks/src/largetable/ng2/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, inject, Input} from '@angular/core';
import {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';
import {DomSanitizer, SafeStyle} from '@angular/platform-browser';

import {emptyTable, TableCell} from '../util';
Expand All @@ -27,6 +27,7 @@ let trustedGreyColor: SafeStyle | null = null;
}
</tbody>
</table>`,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TableComponent {
@Input() data: TableCell[][] = emptyTable;
Expand Down
9 changes: 8 additions & 1 deletion modules/benchmarks/src/largetable/ng2_switch/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, Input, NgModule, provideZoneChangeDetection} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
Input,
NgModule,
provideZoneChangeDetection,
} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';

import {emptyTable, TableCell} from '../util';
Expand All @@ -26,6 +32,7 @@ import {emptyTable, TableCell} from '../util';
</tbody>
</table>`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TableComponent {
@Input() data: TableCell[][] = emptyTable;
Expand Down
8 changes: 7 additions & 1 deletion modules/benchmarks/src/tree/ng2/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, NgModule, provideZoneChangeDetection} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
NgModule,
provideZoneChangeDetection,
} from '@angular/core';
import {BrowserModule, DomSanitizer, SafeStyle} from '@angular/platform-browser';

import {emptyTree, TreeNode} from '../util';
Expand All @@ -21,6 +26,7 @@ let trustedGreyColor: SafeStyle;
><tree *ngIf="data.right != null" [data]="data.right"></tree
><tree *ngIf="data.left != null" [data]="data.left"></tree>`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TreeComponent {
data: TreeNode = emptyTree;
Expand Down
10 changes: 9 additions & 1 deletion modules/benchmarks/src/tree/ng2_static/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, Input, NgModule, provideZoneChangeDetection} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
Input,
NgModule,
provideZoneChangeDetection,
} from '@angular/core';
import {BrowserModule, DomSanitizer, SafeStyle} from '@angular/platform-browser';

import {emptyTree, getMaxDepth, TreeNode} from '../util';
Expand All @@ -26,6 +32,7 @@ function createTreeComponent(level: number, isLeaf: boolean) {
template: template,
standalone: false,
jit: true,
changeDetection: ChangeDetectionStrategy.Eager,
})
class TreeComponent {
@Input() data!: TreeNode;
Expand All @@ -42,6 +49,7 @@ function createTreeComponent(level: number, isLeaf: boolean) {
template: `<tree0 *ngIf="data.left != null" [data]="data"></tree0>`,
standalone: false,
jit: true,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class RootTreeComponent {
@Input() data: TreeNode = emptyTree;
Expand Down
9 changes: 8 additions & 1 deletion modules/benchmarks/src/tree/ng2_switch/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, Input, NgModule, provideZoneChangeDetection} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
Input,
NgModule,
provideZoneChangeDetection,
} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';

import {emptyTree, TreeNode} from '../util';
Expand All @@ -20,6 +26,7 @@ import {emptyTree, TreeNode} from '../util';
><tree *ngIf="data.left != null" [data]="data.left"></tree
></ng-container>`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class TreeComponent {
@Input() data: TreeNode = emptyTree;
Expand Down
8 changes: 7 additions & 1 deletion modules/playground/src/async/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {Component, NgModule, provideZoneChangeDetection} from '@angular/core';
import {
ChangeDetectionStrategy,
Component,
NgModule,
provideZoneChangeDetection,
} from '@angular/core';
import {BrowserModule, platformBrowser} from '@angular/platform-browser';

@Component({
Expand Down Expand Up @@ -43,6 +48,7 @@ import {BrowserModule, platformBrowser} from '@angular/platform-browser';
</div>
`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
class AsyncApplication {
val1: number = 0;
Expand Down
3 changes: 2 additions & 1 deletion modules/playground/src/http/app/http_comp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {HttpClient} from '@angular/common/http';
import {Component} from '@angular/core';
import {ChangeDetectionStrategy, Component} from '@angular/core';

@Component({
selector: 'http-app',
Expand All @@ -18,6 +18,7 @@ import {Component} from '@angular/core';
</ul>
`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class HttpCmp {
people: {name: string}[] = [];
Expand Down
3 changes: 2 additions & 1 deletion modules/playground/src/jsonp/app/jsonp_comp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {HttpClient} from '@angular/common/http';
import {Component} from '@angular/core';
import {ChangeDetectionStrategy, Component} from '@angular/core';

interface Person {
name: string;
Expand All @@ -22,6 +22,7 @@ interface Person {
</ul>
`,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class JsonpCmp {
people: Person[] = [];
Expand Down
3 changes: 2 additions & 1 deletion modules/playground/src/template_driven_forms/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* tslint:disable:no-console */

import {Component, Directive, Host, NgModule} from '@angular/core';
import {ChangeDetectionStrategy, Component, Directive, Host, NgModule} from '@angular/core';
import {FormControl, FormGroup, FormsModule, NG_VALIDATORS, NgForm} from '@angular/forms';
import {BrowserModule, platformBrowser} from '@angular/platform-browser';

Expand Down Expand Up @@ -71,6 +71,7 @@ export class CreditCardValidator {}
inputs: ['controlPath: control', 'errorTypes: errors'],
template: ` <span *ngIf="errorMessage !== null">{{ errorMessage }}</span> `,
standalone: false,
changeDetection: ChangeDetectionStrategy.Eager,
})
export class ShowError {
formDir: NgForm;
Expand Down
Loading
Loading