Skip to content

Commit b1e7e5c

Browse files
committed
save
1 parent b76e59d commit b1e7e5c

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
import { compileFixture } from "./src/index.ts";
1+
import { compileWithOxc } from "./src/compilers/oxc.js";
2+
import { compileWithAngular } from "./src/compilers/angular.js";
23
import { fixtures } from "./fixtures/i18n/i18n-nested.fixture.ts";
34

4-
const fixture = fixtures.find((f) => f.name === "i18n-on-ng-template-with-ngIfElse");
5+
const fixture = fixtures.find((f) => f.name === "i18n-same-static-attr-in-conditionals");
56
if (!fixture) {
67
console.error("Fixture not found");
78
process.exit(1);
89
}
910

10-
const result = compileFixture(fixture, true);
11-
console.log("===== TypeScript Full =====");
12-
console.log(result.tsOutput.fullCode);
13-
console.log("\n===== OXC Full =====");
14-
console.log(result.oxcOutput.fullCode);
11+
const filePath = `/fixtures/${fixture.category}/${fixture.name}.component.ts`;
12+
13+
const tsResult = compileWithAngular(fixture.template!, fixture.className, filePath, {});
14+
const oxcResult = compileWithOxc(fixture.template!, fixture.className, filePath, {});
15+
16+
console.log("===== TypeScript =====");
17+
console.log(tsResult.code);
18+
console.log("\n===== OXC =====");
19+
console.log(oxcResult.code);

napi/angular-compiler/e2e/compare/fixtures/i18n/i18n-nested.fixture.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,28 @@ export const fixtures: Fixture[] = [
227227
`,
228228
expectedFeatures: ["ɵɵi18nStart", "ɵɵi18nEnd"],
229229
},
230+
{
231+
name: "i18n-with-templates-and-text",
232+
category: "i18n",
233+
description: "i18n block with ng-templates having ngTemplateOutlet and interpolation - matches DatepickerComponent pattern",
234+
className: "I18nWithTemplatesAndTextComponent",
235+
template: `
236+
<ng-template [ngIf]="showContent">
237+
<ng-template #tmplRef1><span>Template 1</span></ng-template>
238+
<ng-template #tmplRef2><span>Template 2</span></ng-template>
239+
<ng-template #tmplRef3><span>Template 3</span></ng-template>
240+
<div i18n>
241+
<div [ngClass]="classA">
242+
<div>{{ inputLabel }}</div>
243+
<ng-template [ngTemplateOutlet]="tmplRef1"></ng-template>
244+
</div>
245+
<div [ngClass]="classB">
246+
<ng-template [ngTemplateOutlet]="tmplRef2"></ng-template>
247+
</div>
248+
<ng-template [ngTemplateOutlet]="tmplRef3"></ng-template>
249+
</div>
250+
</ng-template>
251+
`,
252+
expectedFeatures: ["ɵɵi18nStart", "ɵɵi18nEnd", "ɵɵi18nExp", "ɵɵproperty"],
253+
},
230254
];

0 commit comments

Comments
 (0)