Skip to content
Prev Previous commit
Next Next commit
build: Migrate all integration tests with the schematic.
All components, directives and pipes will now use standalone as default. Non-standalone decorators have now .
  • Loading branch information
JeanMeche committed Oct 12, 2024
commit 6217274511855cd669ba05d7d2ac62561bbfafc5
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('AppComponent', () => {
@Component({
selector: 'app-title-ce',
template: '',
standalone: false,
})
class TestTitleComponent {
@Input() appName = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Component} from '@angular/core';
@Component({
selector: 'app-root',
template: '<app-title-ce [appName]="title"></app-title-ce>',
standalone: false,
})
export class AppComponent {
title = 'cli-elements-universal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Component, Input} from '@angular/core';
@Component({
selector: 'app-title',
template: '<h1>{{ appName }} app is running!</h1>',
standalone: false,
})
export class TitleComponent {
@Input() appName = 'Unknown';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Component, Inject, LOCALE_ID} from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: false,
})
export class AppComponent {
constructor(@Inject(LOCALE_ID) public locale: string) {}
Expand Down
1 change: 1 addition & 0 deletions integration/cli-hello-world-mocha/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Component} from '@angular/core';
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
standalone: false,
})
export class AppComponent {
title = 'cli-hello-world';
Expand Down
1 change: 1 addition & 0 deletions integration/cli-hello-world/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Component} from '@angular/core';
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
standalone: false,
})
export class AppComponent {
title = 'cli-hello-world';
Expand Down
1 change: 1 addition & 0 deletions integration/dynamic-compiler/src/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {AfterViewInit, Compiler, Component, ViewChild, ViewContainerRef} from '@
<h1>Hello world!</h1>
<div #vc></div>
`,
standalone: false,
})
export class AppComponent implements AfterViewInit {
@ViewChild('vc', {read: ViewContainerRef}) container: ViewContainerRef;
Expand Down
1 change: 1 addition & 0 deletions integration/dynamic-compiler/src/lazy.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {NgModule, Component} from '@angular/core';
selector: 'lazy-component',
template: 'Lazy-loaded component!',
jit: true,
standalone: false,
})
export class LazyComponent {}

Expand Down
3 changes: 3 additions & 0 deletions integration/forms/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angul
<button (click)="addCity()">Add City</button>
</div>
</form>`,
standalone: false,
})
export class TemplateFormsComponent {
name = {first: 'Nancy', last: 'Drew', subscribed: true};
Expand Down Expand Up @@ -68,6 +69,7 @@ export class TemplateFormsComponent {
</div>
<button (click)="addCity()">Add City</button>
</form>`,
standalone: false,
})
export class ReactiveFormsComponent {
profileForm!: FormGroup;
Expand Down Expand Up @@ -109,5 +111,6 @@ export class ReactiveFormsComponent {
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: false,
})
export class AppComponent {}
1 change: 1 addition & 0 deletions integration/injectable-def/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {Lib2Module} from 'lib2_built';
@Component({
selector: 'test-app',
template: '<test-cmp></test-cmp>',
standalone: false,
})
export class TestApp {}

Expand Down
1 change: 1 addition & 0 deletions integration/injectable-def/src/lib2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Lib1Module, Service} from 'lib1_built';
@Component({
selector: 'test-cmp',
template: '{{instance1}}:{{instance2}}',
standalone: false,
})
export class TestCmp {
instance1: number;
Expand Down
1 change: 1 addition & 0 deletions integration/ivy-i18n/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Component, Inject, LOCALE_ID} from '@angular/core';
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
standalone: false,
})
export class AppComponent {
constructor(@Inject(LOCALE_ID) public locale: string) {}
Expand Down
1 change: 1 addition & 0 deletions integration/ng-add-localize/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {Component} from '@angular/core';

`,
styles: [],
standalone: false,
})
export class AppComponent {
title = $localize`ng-add-localize`;
Expand Down
4 changes: 4 additions & 0 deletions integration/ng_elements/src/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {ChangeDetectionStrategy, Component, Input, ViewEncapsulation} from '@ang
@Component({
selector: 'hello-world-el',
template: 'Hello {{name}}!',
standalone: false,
})
export class HelloWorldComponent {
@Input() name: string = 'World';
Expand All @@ -12,6 +13,7 @@ export class HelloWorldComponent {
selector: 'hello-world-onpush-el',
template: 'Hello {{name}}!',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
})
export class HelloWorldOnpushComponent {
@Input() name: string = 'World';
Expand All @@ -21,6 +23,7 @@ export class HelloWorldOnpushComponent {
selector: 'hello-world-shadow-el',
template: 'Hello {{name}}!',
encapsulation: ViewEncapsulation.ShadowDom,
standalone: false,
})
export class HelloWorldShadowComponent {
@Input() name: string = 'World';
Expand All @@ -37,5 +40,6 @@ export class HelloWorldShadowComponent {
<slot name="card-footer"></slot>
</footer>`,
encapsulation: ViewEncapsulation.ShadowDom,
standalone: false,
})
export class TestCardComponent {}
1 change: 1 addition & 0 deletions integration/ng_update_migrations/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Component} from '@angular/core';
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less'],
standalone: false,
})
export class AppComponent {
title = 'ng-update-migrations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import {Component} from '@angular/core';
@Component({
selector: 'app-root',
template: '<router-outlet></router-outlet>',
standalone: false,
})
export class AppComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {Component} from '@angular/core';
}
`,
],
standalone: false,
})
export class HelloWorldComponent {
name: string = 'world';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Component, OnInit} from '@angular/core';
@Component({
selector: 'transfer-state-http-on-init',
template: ` <div class="one">{{ responseOne }}</div> `,
standalone: false,
})
export class TransferStateComponentOnInit implements OnInit {
responseOne: string = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {Component, OnInit} from '@angular/core';
<div class="one">{{ responseOne }}</div>
<div class="two">{{ responseTwo }}</div>
`,
standalone: false,
})
export class TransferStateComponent implements OnInit {
responseOne: string = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const COUNTER_KEY = makeStateKey<number>('counter');
@Component({
selector: 'transfer-state',
template: ` <div>{{ counter }}</div> `,
standalone: false,
})
export class TransferStateComponent {
counter = 0;
Expand Down
1 change: 1 addition & 0 deletions integration/trusted-types/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {DomSanitizer, SafeHtml, SafeResourceUrl} from '@angular/platform-browser
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
standalone: false,
})
export class AppComponent {
title = 'trusted-types';
Expand Down