mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: Migrate all integration tests with the schematic. (#58160)
All components, directives and pipes will now use standalone as default. Non-standalone decorators have now . PR Close #58160
This commit is contained in:
committed by
Paul Gschwendtner
parent
30766d6b77
commit
e85021a7ba
@@ -36,6 +36,7 @@ describe('AppComponent', () => {
|
||||
@Component({
|
||||
selector: 'app-title-ce',
|
||||
template: '',
|
||||
standalone: false,
|
||||
})
|
||||
class TestTitleComponent {
|
||||
@Input() appName = '';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -4,6 +4,7 @@ import {NgModule, Component} from '@angular/core';
|
||||
selector: 'lazy-component',
|
||||
template: 'Lazy-loaded component!',
|
||||
jit: true,
|
||||
standalone: false,
|
||||
})
|
||||
export class LazyComponent {}
|
||||
|
||||
|
||||
@@ -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};
|
||||
@@ -68,6 +69,7 @@ export class TemplateFormsComponent {
|
||||
</div>
|
||||
<button (click)="addCity()">Add City</button>
|
||||
</form>`,
|
||||
standalone: false,
|
||||
})
|
||||
export class ReactiveFormsComponent {
|
||||
profileForm!: FormGroup;
|
||||
@@ -109,5 +111,6 @@ export class ReactiveFormsComponent {
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
standalone: false,
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
||||
@@ -6,6 +6,7 @@ import {Lib2Module} from 'lib2_built';
|
||||
@Component({
|
||||
selector: 'test-app',
|
||||
template: '<test-cmp></test-cmp>',
|
||||
standalone: false,
|
||||
})
|
||||
export class TestApp {}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import {Lib1Module, Service} from 'lib1_built';
|
||||
@Component({
|
||||
selector: 'test-cmp',
|
||||
template: '{{instance1}}:{{instance2}}',
|
||||
standalone: false,
|
||||
})
|
||||
export class TestCmp {
|
||||
instance1: number;
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -26,6 +26,7 @@ import {Component} from '@angular/core';
|
||||
|
||||
`,
|
||||
styles: [],
|
||||
standalone: false,
|
||||
})
|
||||
export class AppComponent {
|
||||
title = $localize`ng-add-localize`;
|
||||
|
||||
@@ -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';
|
||||
@@ -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';
|
||||
@@ -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';
|
||||
@@ -37,5 +40,6 @@ export class HelloWorldShadowComponent {
|
||||
<slot name="card-footer"></slot>
|
||||
</footer>`,
|
||||
encapsulation: ViewEncapsulation.ShadowDom,
|
||||
standalone: false,
|
||||
})
|
||||
export class TestCardComponent {}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -3,5 +3,6 @@ import {Component} from '@angular/core';
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
template: '<router-outlet></router-outlet>',
|
||||
standalone: false,
|
||||
})
|
||||
export class AppComponent {}
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ import {Component} from '@angular/core';
|
||||
}
|
||||
`,
|
||||
],
|
||||
standalone: false,
|
||||
})
|
||||
export class HelloWorldComponent {
|
||||
name: string = 'world';
|
||||
|
||||
+1
@@ -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 = '';
|
||||
|
||||
+1
@@ -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 = '';
|
||||
|
||||
+1
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user