Skip to content

Commit

Permalink
test(compiler): Update golden partial file (#53327)
Browse files Browse the repository at this point in the history
Update the golden partial file to include the newly added tests in this
PR.

PR Close #53327
  • Loading branch information
mmalerba authored and dylhunn committed Dec 4, 2023
1 parent 326a602 commit dc27bea
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,40 @@ export declare class MyModule {
static ɵinj: i0.ɵɵInjectorDeclaration<MyModule>;
}

/****************************************************************************************************
* PARTIAL FILE: nested_ng-content.js
****************************************************************************************************/
import { Component } from '@angular/core';
import * as i0 from "@angular/core";
export class MyComponent {
}
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: MyComponent, isStandalone: true, selector: "my-component", ngImport: i0, template: `
<div i18n>
<ng-content select="special"></ng-content>
<ng-content></ng-content>
</div>
`, isInline: true });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
type: Component,
args: [{
selector: 'my-component',
standalone: true,
template: `
<div i18n>
<ng-content select="special"></ng-content>
<ng-content></ng-content>
</div>
`,
}]
}] });

/****************************************************************************************************
* PARTIAL FILE: nested_ng-content.d.ts
****************************************************************************************************/
import * as i0 from "@angular/core";
export declare class MyComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<MyComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MyComponent, "my-component", never, {}, {}, never, ["special", "*"], true, never>;
}

Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,44 @@ export declare class MyModule {
static ɵinj: i0.ɵɵInjectorDeclaration<MyModule>;
}

/****************************************************************************************************
* PARTIAL FILE: sibling_i18n_blocks.js
****************************************************************************************************/
import { Component } from '@angular/core';
import * as i0 from "@angular/core";
export class MyComponent {
}
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: MyComponent, isStandalone: true, selector: "my-component", ngImport: i0, template: `
<div i18n>
<ng-template>Content A</ng-template>
</div>
<div i18n>
<ng-template>Content B</ng-template>
</div>
`, isInline: true });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
type: Component,
args: [{
selector: 'my-component',
standalone: true,
template: `
<div i18n>
<ng-template>Content A</ng-template>
</div>
<div i18n>
<ng-template>Content B</ng-template>
</div>
`,
}]
}] });

/****************************************************************************************************
* PARTIAL FILE: sibling_i18n_blocks.d.ts
****************************************************************************************************/
import * as i0 from "@angular/core";
export declare class MyComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<MyComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MyComponent, "my-component", never, {}, {}, never, never, true, never>;
}

Original file line number Diff line number Diff line change
Expand Up @@ -1056,3 +1056,59 @@ export declare class MyComponent {
static ɵcmp: i0.ɵɵComponentDeclaration<MyComponent, "my-component", never, {}, {}, never, never, true, never>;
}

/****************************************************************************************************
* PARTIAL FILE: self_closing_structural_directives.js
****************************************************************************************************/
import { Component } from '@angular/core';
import * as i0 from "@angular/core";
export class OtherComponent {
}
OtherComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: OtherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
OtherComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: OtherComponent, isStandalone: true, selector: "other-component", ngImport: i0, template: '', isInline: true });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: OtherComponent, decorators: [{
type: Component,
args: [{ selector: 'other-component', standalone: true, template: '' }]
}] });
export class MyComponent {
}
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "0.0.0-PLACEHOLDER", type: MyComponent, isStandalone: true, selector: "my-component", ngImport: i0, template: `
<div i18n>
<img *ngIf="flag" />
<other-component *ngIf="flag" />
<ng-template *ngIf="flag" />
<ng-container *ngIf="flag" />
<ng-content *ngIf="flag" />
</div>
`, isInline: true, dependencies: [{ kind: "component", type: OtherComponent, selector: "other-component" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
type: Component,
args: [{
selector: 'my-component',
standalone: true,
imports: [OtherComponent],
template: `
<div i18n>
<img *ngIf="flag" />
<other-component *ngIf="flag" />
<ng-template *ngIf="flag" />
<ng-container *ngIf="flag" />
<ng-content *ngIf="flag" />
</div>
`,
}]
}] });

/****************************************************************************************************
* PARTIAL FILE: self_closing_structural_directives.d.ts
****************************************************************************************************/
import * as i0 from "@angular/core";
export declare class OtherComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<OtherComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<OtherComponent, "other-component", never, {}, {}, never, never, true, never>;
}
export declare class MyComponent {
static ɵfac: i0.ɵɵFactoryDeclaration<MyComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MyComponent, "my-component", never, {}, {}, never, ["*"], true, never>;
}

Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ function formatValue(value: ir.I18nParamValue): string {
value: value.value.template,
flags: value.flags & ~ir.I18nParamValueFlags.ElementTag
});
// TODO(mmalerba): This is likely a bug in TemplateDefinitionBuilder, we should need to record
// the template value twice. For now I'm re-implementing the behavior here to keep the output
// consistent with TemplateDefinitionBuilder.
// TODO(mmalerba): This is likely a bug in TemplateDefinitionBuilder, we should not need to
// record the template value twice. For now I'm re-implementing the behavior here to keep the
// output consistent with TemplateDefinitionBuilder.
if ((value.flags & ir.I18nParamValueFlags.OpenTag) &&
(value.flags & ir.I18nParamValueFlags.CloseTag)) {
return `${templateValue}${elementValue}${templateValue}`;
Expand Down

0 comments on commit dc27bea

Please sign in to comment.