refactor(common): remove standalone: true (#58949)

Removed the standalone true flag from common packages.

PR Close #58949
This commit is contained in:
Sheik Althaf 2024-11-28 14:16:33 +05:30 committed by Pawel Kozlowski
parent e894a5daea
commit 9658dd1fe3
34 changed files with 0 additions and 57 deletions

View file

@ -68,7 +68,6 @@ interface CssClassState {
*/
@Directive({
selector: '[ngClass]',
standalone: true,
})
export class NgClass implements DoCheck {
private initialClasses = EMPTY_ARRAY;

View file

@ -167,7 +167,6 @@ export class NgForOfContext<T, U extends NgIterable<T> = NgIterable<T>> {
*/
@Directive({
selector: '[ngFor][ngForOf]',
standalone: true,
})
export class NgForOf<T, U extends NgIterable<T> = NgIterable<T>> implements DoCheck {
/**

View file

@ -156,7 +156,6 @@ import {
*/
@Directive({
selector: '[ngIf]',
standalone: true,
})
export class NgIf<T = unknown> {
private _context: NgIfContext<T> = new NgIfContext<T>();

View file

@ -213,7 +213,6 @@ export interface ImagePlaceholderConfig {
*
* // ... or a standalone Component
* @Component({
* standalone: true
* imports: [NgOptimizedImage],
* })
* class MyStandaloneComponent {}
@ -272,7 +271,6 @@ export interface ImagePlaceholderConfig {
* @publicApi
*/
@Directive({
standalone: true,
selector: 'img[ngSrc]',
host: {
'[style.position]': 'fill ? "absolute" : null',

View file

@ -45,7 +45,6 @@ import {SwitchView} from './ng_switch';
*/
@Directive({
selector: '[ngPlural]',
standalone: true,
})
export class NgPlural {
private _activeView?: SwitchView;
@ -104,7 +103,6 @@ export class NgPlural {
*/
@Directive({
selector: '[ngPluralCase]',
standalone: true,
})
export class NgPluralCase {
constructor(

View file

@ -55,7 +55,6 @@ import {
*/
@Directive({
selector: '[ngStyle]',
standalone: true,
})
export class NgStyle implements DoCheck {
private _ngStyle: {[key: string]: string} | null | undefined = null;

View file

@ -114,7 +114,6 @@ export class SwitchView {
*/
@Directive({
selector: '[ngSwitch]',
standalone: true,
})
export class NgSwitch {
private _defaultViews: SwitchView[] = [];
@ -200,7 +199,6 @@ export class NgSwitch {
*/
@Directive({
selector: '[ngSwitchCase]',
standalone: true,
})
export class NgSwitchCase implements DoCheck {
private _view: SwitchView;
@ -247,7 +245,6 @@ export class NgSwitchCase implements DoCheck {
*/
@Directive({
selector: '[ngSwitchDefault]',
standalone: true,
})
export class NgSwitchDefault {
constructor(

View file

@ -44,7 +44,6 @@ import {
*/
@Directive({
selector: '[ngTemplateOutlet]',
standalone: true,
})
export class NgTemplateOutlet<C = unknown> implements OnChanges {
private _viewRef: EmbeddedViewRef<C> | null = null;

View file

@ -97,7 +97,6 @@ const _subscribableStrategy = new SubscribableStrategy();
@Pipe({
name: 'async',
pure: false,
standalone: true,
})
export class AsyncPipe implements OnDestroy, PipeTransform {
private _ref: ChangeDetectorRef | null;

View file

@ -27,7 +27,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
*/
@Pipe({
name: 'lowercase',
standalone: true,
})
export class LowerCasePipe implements PipeTransform {
/**
@ -76,7 +75,6 @@ const unicodeWordMatch =
*/
@Pipe({
name: 'titlecase',
standalone: true,
})
export class TitleCasePipe implements PipeTransform {
/**
@ -108,7 +106,6 @@ export class TitleCasePipe implements PipeTransform {
*/
@Pipe({
name: 'uppercase',
standalone: true,
})
export class UpperCasePipe implements PipeTransform {
/**

View file

@ -218,7 +218,6 @@ export const DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken<DatePipeConfig>(
*/
@Pipe({
name: 'date',
standalone: true,
})
export class DatePipe implements PipeTransform {
constructor(

View file

@ -30,7 +30,6 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
*/
@Pipe({
name: 'i18nPlural',
standalone: true,
})
export class I18nPluralPipe implements PipeTransform {
constructor(private _localization: NgLocalization) {}

View file

@ -29,7 +29,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
*/
@Pipe({
name: 'i18nSelect',
standalone: true,
})
export class I18nSelectPipe implements PipeTransform {
/**

View file

@ -26,7 +26,6 @@ import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'json',
pure: false,
standalone: true,
})
export class JsonPipe implements PipeTransform {
/**

View file

@ -54,7 +54,6 @@ export interface KeyValue<K, V> {
@Pipe({
name: 'keyvalue',
pure: false,
standalone: true,
})
export class KeyValuePipe implements PipeTransform {
constructor(private readonly differs: KeyValueDiffers) {}

View file

@ -78,7 +78,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
*/
@Pipe({
name: 'number',
standalone: true,
})
export class DecimalPipe implements PipeTransform {
constructor(@Inject(LOCALE_ID) private _locale: string) {}
@ -137,7 +136,6 @@ export class DecimalPipe implements PipeTransform {
*/
@Pipe({
name: 'percent',
standalone: true,
})
export class PercentPipe implements PipeTransform {
constructor(@Inject(LOCALE_ID) private _locale: string) {}
@ -204,7 +202,6 @@ export class PercentPipe implements PipeTransform {
*/
@Pipe({
name: 'currency',
standalone: true,
})
export class CurrencyPipe implements PipeTransform {
constructor(

View file

@ -48,7 +48,6 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
@Pipe({
name: 'slice',
pure: false,
standalone: true,
})
export class SlicePipe implements PipeTransform {
/**

View file

@ -467,7 +467,6 @@ describe('binding to CSS class list', () => {
selector: 'test-component',
imports: [NgClass],
template: `<div class="{{ 'option-' + level }}" [ngClass]="'option-' + level"></div>`,
standalone: true,
})
class TestComponent {
level = 1;
@ -488,7 +487,6 @@ describe('binding to CSS class list', () => {
selector: 'test-component',
imports: [NgClass],
template: `<div trailing-space [ngClass]="{foo: applyClasses}"></div>`,
standalone: true,
})
class TestComponent {
applyClasses = true;

View file

@ -284,7 +284,6 @@ describe('insert/remove', () => {
it('should be available as a standalone directive', () => {
@Component({
standalone: true,
template: 'Hello World',
})
class HelloWorldComp {}
@ -293,7 +292,6 @@ describe('insert/remove', () => {
selector: 'test-component',
imports: [NgComponentOutlet],
template: ` <ng-container *ngComponentOutlet="component"></ng-container> `,
standalone: true,
})
class TestComponent {
component = HelloWorldComp;
@ -488,7 +486,6 @@ export class TestModule3 {}
@Component({
selector: 'cmp-with-inputs',
standalone: true,
template: `foo: {{ foo }}, bar: {{ bar }}, baz: {{ baz }}`,
})
class ComponentWithInputs {
@ -499,7 +496,6 @@ class ComponentWithInputs {
@Component({
selector: 'another-cmp-with-inputs',
standalone: true,
template: `[ANOTHER] foo: {{ foo }}, bar: {{ bar }}, baz: {{ baz }}`,
})
class AnotherComponentWithInputs {
@ -510,7 +506,6 @@ class AnotherComponentWithInputs {
@Component({
selector: 'test-cmp',
standalone: true,
imports: [NgComponentOutlet],
template: `<ng-template *ngComponentOutlet="currentComponent; inputs: inputs"></ng-template>`,
})

View file

@ -394,7 +394,6 @@ describe('ngFor', () => {
selector: 'test-component',
imports: [NgForOf],
template: ` <ng-container *ngFor="let item of items">{{ item }}|</ng-container> `,
standalone: true,
})
class TestComponent {
items = [1, 2, 3];
@ -411,7 +410,6 @@ describe('ngFor', () => {
selector: 'test-component',
imports: [NgFor],
template: ` <ng-container *ngFor="let item of items">{{ item }}|</ng-container> `,
standalone: true,
})
class TestComponent {
items = [1, 2, 3];

View file

@ -261,7 +261,6 @@ describe('ngIf directive', () => {
<div *ngIf="true">Hello</div>
<div *ngIf="false">World</div>
`,
standalone: true,
})
class TestComponent {}

View file

@ -153,7 +153,6 @@ it('should be available as a standalone directive', () => {
'<ng-template ngPluralCase="=0"><li>no messages</li></ng-template>' +
'<ng-template ngPluralCase="=1"><li>one message</li></ng-template>' +
'</ul>',
standalone: true,
})
class TestComponent {
switchValue = 1;

View file

@ -242,7 +242,6 @@ describe('NgStyle', () => {
selector: 'test-component',
imports: [NgStyle],
template: `<div [ngStyle]="{'width.px': expr}"></div>`,
standalone: true,
})
class TestComponent {
expr = 400;

View file

@ -150,7 +150,6 @@ describe('NgSwitch', () => {
'<li *ngSwitchCase="\'a\'">when a</li>' +
'<li *ngSwitchDefault>when default</li>' +
'</ul>',
standalone: true,
})
class TestComponent {
switchValue = 'a';

View file

@ -337,7 +337,6 @@ describe('NgTemplateOutlet', () => {
<ng-template #tpl>Hello World</ng-template>
<ng-container *ngTemplateOutlet="tpl"></ng-container>
`,
standalone: true,
})
class TestComponent {}
@ -354,7 +353,6 @@ describe('NgTemplateOutlet', () => {
<ng-template #tpl let-name>Name:{{ name }}</ng-template>
<ng-template [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="ctx"></ng-template>
`,
standalone: true,
})
class TestComponent {
ctx: {$implicit: string} | undefined = undefined;

View file

@ -284,7 +284,6 @@ describe('AsyncPipe', () => {
selector: 'test-component',
imports: [AsyncPipe],
template: '{{ value | async }}',
standalone: true,
})
class TestComponent {
value = of('foo');

View file

@ -45,7 +45,6 @@ describe('LowerCasePipe', () => {
selector: 'test-component',
imports: [LowerCasePipe],
template: '{{ value | lowercase }}',
standalone: true,
})
class TestComponent {
value = 'FOO';
@ -137,7 +136,6 @@ describe('TitleCasePipe', () => {
selector: 'test-component',
imports: [TitleCasePipe],
template: '{{ value | titlecase }}',
standalone: true,
})
class TestComponent {
value = 'foo';
@ -186,7 +184,6 @@ describe('UpperCasePipe', () => {
selector: 'test-component',
imports: [UpperCasePipe],
template: '{{ value | uppercase }}',
standalone: true,
})
class TestComponent {
value = 'foo';

View file

@ -82,7 +82,6 @@ describe('DatePipe', () => {
selector: 'test-component',
imports: [DatePipe],
template: '{{ value | date }}',
standalone: true,
providers: [{provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}}],
})
class TestComponent {
@ -101,7 +100,6 @@ describe('DatePipe', () => {
selector: 'test-component',
imports: [DatePipe],
template: '{{ value | date }}',
standalone: true,
})
class TestComponent {
value = '2017-01-11T10:14:39+0000';
@ -176,7 +174,6 @@ describe('DatePipe', () => {
selector: 'test-component',
imports: [DatePipe],
template: '{{ value | date }}',
standalone: true,
providers: [{provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}}],
})
class TestComponent {
@ -195,7 +192,6 @@ describe('DatePipe', () => {
selector: 'test-component',
imports: [DatePipe],
template: '{{ value | date }}',
standalone: true,
})
class TestComponent {
value = '2017-01-11T00:00:00';
@ -218,7 +214,6 @@ describe('DatePipe', () => {
selector: 'test-component',
imports: [DatePipe],
template: '{{ value | date }}',
standalone: true,
})
class TestComponent {
value = '2017-01-11T10:14:39+0000';

View file

@ -67,7 +67,6 @@ describe('I18nPluralPipe', () => {
selector: 'test-component',
imports: [I18nPluralPipe],
template: '{{ value | i18nPlural:mapping }}',
standalone: true,
})
class TestComponent {
value = 1;

View file

@ -43,7 +43,6 @@ describe('I18nSelectPipe', () => {
selector: 'test-component',
imports: [I18nSelectPipe],
template: '{{ value | i18nSelect:mapping }}',
standalone: true,
})
class TestComponent {
value = 'other';

View file

@ -85,7 +85,6 @@ describe('JsonPipe', () => {
selector: 'test-component',
imports: [JsonPipe],
template: '{{ value | json }}',
standalone: true,
})
class TestComponent {
value = {'a': 1};

View file

@ -221,7 +221,6 @@ describe('KeyValuePipe', () => {
selector: 'test-component',
imports: [KeyValuePipe, JsonPipe],
template: '{{ value | keyvalue | json }}',
standalone: true,
})
class TestComponent {
value = {'b': 1, 'a': 2};

View file

@ -83,7 +83,6 @@ describe('Number pipes', () => {
selector: 'test-component',
imports: [DecimalPipe],
template: '{{ value | number }}',
standalone: true,
})
class TestComponent {
value = 12345;
@ -136,7 +135,6 @@ describe('Number pipes', () => {
selector: 'test-component',
imports: [PercentPipe],
template: '{{ value | percent }}',
standalone: true,
})
class TestComponent {
value = 15;
@ -234,7 +232,6 @@ describe('Number pipes', () => {
selector: 'test-component',
imports: [CurrencyPipe],
template: '{{ value | currency }}',
standalone: true,
})
class TestComponent {
value = 15;

View file

@ -121,7 +121,6 @@ describe('SlicePipe', () => {
selector: 'test-component',
imports: [SlicePipe],
template: '{{ title | slice:0:5 }}',
standalone: true,
})
class TestComponent {
title = 'Hello World!';