Skip to content

Commit 81e48f0

Browse files
committed
update, but not working
1 parent e166bab commit 81e48f0

File tree

9 files changed

+535
-156
lines changed

9 files changed

+535
-156
lines changed

packages/core/src/__tests__/__snapshots__/angular.import.test.ts.snap

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4665,6 +4665,49 @@ export class MyComponentModule {}
46654665
"
46664666
`;
46674667

4668+
exports[`Angular with Preserve Imports and File Extensions > jsx > Javascript Test > escapeQuotesInnerHTML 1`] = `
4669+
"/**
4670+
useMetadata:
4671+
{\\"angular\\":{\\"changeDetection\\":\\"OnPush\\"}}
4672+
*/
4673+
4674+
import { NgModule } from \\"@angular/core\\";
4675+
import { CommonModule } from \\"@angular/common\\";
4676+
4677+
import { Component, ChangeDetectionStrategy } from \\"@angular/core\\";
4678+
import { DomSanitizer } from \\"@angular/platform-browser\\";
4679+
4680+
@Component({
4681+
selector: \\"my-component\\",
4682+
template: \`
4683+
<div
4684+
[innerHTML]='sanitizer.bypassSecurityTrustHtml(\\\\\`<link href=\\"https://fonts.googleapis.com/css2?family=Inter&display=swap\\" rel=\\"stylesheet\\">
4685+
<script src=\\"URL_1\\" defer></script>
4686+
<script src=\\"URL_2\\"></script>\\\\\`)'
4687+
></div>
4688+
\`,
4689+
changeDetection: ChangeDetectionStrategy.OnPush,
4690+
styles: [
4691+
\`
4692+
:host {
4693+
display: contents;
4694+
}
4695+
\`,
4696+
],
4697+
})
4698+
export default class MyComponent {
4699+
constructor(protected sanitizer) {}
4700+
}
4701+
4702+
@NgModule({
4703+
declarations: [MyComponent],
4704+
imports: [CommonModule],
4705+
exports: [MyComponent],
4706+
})
4707+
export class MyComponentModule {}
4708+
"
4709+
`;
4710+
46684711
exports[`Angular with Preserve Imports and File Extensions > jsx > Javascript Test > eventInputAndChange 1`] = `
46694712
"import { NgModule } from \\"@angular/core\\";
46704713
import { CommonModule } from \\"@angular/common\\";
@@ -12922,6 +12965,53 @@ export class MyComponentModule {}
1292212965
"
1292312966
`;
1292412967

12968+
exports[`Angular with Preserve Imports and File Extensions > jsx > Typescript Test > escapeQuotesInnerHTML 1`] = `
12969+
"/**
12970+
useMetadata:
12971+
{\\"angular\\":{\\"changeDetection\\":\\"OnPush\\"}}
12972+
*/
12973+
12974+
import { NgModule } from \\"@angular/core\\";
12975+
import { CommonModule } from \\"@angular/common\\";
12976+
12977+
import { Component, ChangeDetectionStrategy } from \\"@angular/core\\";
12978+
import { DomSanitizer } from \\"@angular/platform-browser\\";
12979+
12980+
export interface MyComponentProps {
12981+
text?: string;
12982+
}
12983+
12984+
@Component({
12985+
selector: \\"my-component\\",
12986+
template: \`
12987+
<div
12988+
[innerHTML]='sanitizer.bypassSecurityTrustHtml(\\\\\`<link href=\\"https://fonts.googleapis.com/css2?family=Inter&display=swap\\" rel=\\"stylesheet\\">
12989+
<script src=\\"URL_1\\" defer></script>
12990+
<script src=\\"URL_2\\"></script>\\\\\`)'
12991+
></div>
12992+
\`,
12993+
changeDetection: ChangeDetectionStrategy.OnPush,
12994+
styles: [
12995+
\`
12996+
:host {
12997+
display: contents;
12998+
}
12999+
\`,
13000+
],
13001+
})
13002+
export default class MyComponent {
13003+
constructor(protected sanitizer: DomSanitizer) {}
13004+
}
13005+
13006+
@NgModule({
13007+
declarations: [MyComponent],
13008+
imports: [CommonModule],
13009+
exports: [MyComponent],
13010+
})
13011+
export class MyComponentModule {}
13012+
"
13013+
`;
13014+
1292513015
exports[`Angular with Preserve Imports and File Extensions > jsx > Typescript Test > eventInputAndChange 1`] = `
1292613016
"import { NgModule } from \\"@angular/core\\";
1292713017
import { CommonModule } from \\"@angular/common\\";

packages/core/src/__tests__/__snapshots__/angular.mapper.test.ts.snap

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4735,6 +4735,50 @@ export class MyComponentModule {}
47354735
"
47364736
`;
47374737

4738+
exports[`Angular with Import Mapper Tests > jsx > Javascript Test > escapeQuotesInnerHTML 1`] = `
4739+
"/**
4740+
useMetadata:
4741+
{\\"angular\\":{\\"changeDetection\\":\\"OnPush\\"}}
4742+
*/
4743+
4744+
import { NgModule } from \\"@angular/core\\";
4745+
import { CommonModule } from \\"@angular/common\\";
4746+
4747+
import { Component, ChangeDetectionStrategy } from \\"@angular/core\\";
4748+
import { DomSanitizer } from \\"@angular/platform-browser\\";
4749+
4750+
@Component({
4751+
selector: \\"my-component\\",
4752+
template: \`
4753+
<div
4754+
[innerHTML]='sanitizer.bypassSecurityTrustHtml(\\\\\`<link href=\\"https://fonts.googleapis.com/css2?family=Inter&display=swap\\" rel=\\"stylesheet\\">
4755+
<script src=\\"URL_1\\" defer></script>
4756+
<script src=\\"URL_2\\"></script>\\\\\`)'
4757+
></div>
4758+
\`,
4759+
changeDetection: ChangeDetectionStrategy.OnPush,
4760+
styles: [
4761+
\`
4762+
:host {
4763+
display: contents;
4764+
}
4765+
\`,
4766+
],
4767+
})
4768+
export default class MyComponent {
4769+
constructor(protected sanitizer) {}
4770+
}
4771+
4772+
@NgModule({
4773+
declarations: [MyComponent],
4774+
imports: [CommonModule],
4775+
exports: [MyComponent],
4776+
bootstrap: [SomeOtherComponent],
4777+
})
4778+
export class MyComponentModule {}
4779+
"
4780+
`;
4781+
47384782
exports[`Angular with Import Mapper Tests > jsx > Javascript Test > eventInputAndChange 1`] = `
47394783
"import { NgModule } from \\"@angular/core\\";
47404784
import { CommonModule } from \\"@angular/common\\";
@@ -13127,6 +13171,54 @@ export class MyComponentModule {}
1312713171
"
1312813172
`;
1312913173

13174+
exports[`Angular with Import Mapper Tests > jsx > Typescript Test > escapeQuotesInnerHTML 1`] = `
13175+
"/**
13176+
useMetadata:
13177+
{\\"angular\\":{\\"changeDetection\\":\\"OnPush\\"}}
13178+
*/
13179+
13180+
import { NgModule } from \\"@angular/core\\";
13181+
import { CommonModule } from \\"@angular/common\\";
13182+
13183+
import { Component, ChangeDetectionStrategy } from \\"@angular/core\\";
13184+
import { DomSanitizer } from \\"@angular/platform-browser\\";
13185+
13186+
export interface MyComponentProps {
13187+
text?: string;
13188+
}
13189+
13190+
@Component({
13191+
selector: \\"my-component\\",
13192+
template: \`
13193+
<div
13194+
[innerHTML]='sanitizer.bypassSecurityTrustHtml(\\\\\`<link href=\\"https://fonts.googleapis.com/css2?family=Inter&display=swap\\" rel=\\"stylesheet\\">
13195+
<script src=\\"URL_1\\" defer></script>
13196+
<script src=\\"URL_2\\"></script>\\\\\`)'
13197+
></div>
13198+
\`,
13199+
changeDetection: ChangeDetectionStrategy.OnPush,
13200+
styles: [
13201+
\`
13202+
:host {
13203+
display: contents;
13204+
}
13205+
\`,
13206+
],
13207+
})
13208+
export default class MyComponent {
13209+
constructor(protected sanitizer: DomSanitizer) {}
13210+
}
13211+
13212+
@NgModule({
13213+
declarations: [MyComponent],
13214+
imports: [CommonModule],
13215+
exports: [MyComponent],
13216+
bootstrap: [SomeOtherComponent],
13217+
})
13218+
export class MyComponentModule {}
13219+
"
13220+
`;
13221+
1313013222
exports[`Angular with Import Mapper Tests > jsx > Typescript Test > eventInputAndChange 1`] = `
1313113223
"import { NgModule } from \\"@angular/core\\";
1313213224
import { CommonModule } from \\"@angular/common\\";

packages/core/src/__tests__/__snapshots__/angular.state.test.ts.snap

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4847,6 +4847,49 @@ export class MyComponentModule {}
48474847
"
48484848
`;
48494849

4850+
exports[`Angular with manually creating and handling class properties as bindings (more stable) > jsx > Javascript Test > escapeQuotesInnerHTML 1`] = `
4851+
"/**
4852+
useMetadata:
4853+
{\\"angular\\":{\\"changeDetection\\":\\"OnPush\\"}}
4854+
*/
4855+
4856+
import { NgModule } from \\"@angular/core\\";
4857+
import { CommonModule } from \\"@angular/common\\";
4858+
4859+
import { Component, ChangeDetectionStrategy } from \\"@angular/core\\";
4860+
import { DomSanitizer } from \\"@angular/platform-browser\\";
4861+
4862+
@Component({
4863+
selector: \\"my-component\\",
4864+
template: \`
4865+
<div
4866+
[innerHTML]='sanitizer.bypassSecurityTrustHtml(\\\\\`<link href=\\"https://fonts.googleapis.com/css2?family=Inter&display=swap\\" rel=\\"stylesheet\\">
4867+
<script src=\\"URL_1\\" defer></script>
4868+
<script src=\\"URL_2\\"></script>\\\\\`)'
4869+
></div>
4870+
\`,
4871+
changeDetection: ChangeDetectionStrategy.OnPush,
4872+
styles: [
4873+
\`
4874+
:host {
4875+
display: contents;
4876+
}
4877+
\`,
4878+
],
4879+
})
4880+
export default class MyComponent {
4881+
constructor(protected sanitizer) {}
4882+
}
4883+
4884+
@NgModule({
4885+
declarations: [MyComponent],
4886+
imports: [CommonModule],
4887+
exports: [MyComponent],
4888+
})
4889+
export class MyComponentModule {}
4890+
"
4891+
`;
4892+
48504893
exports[`Angular with manually creating and handling class properties as bindings (more stable) > jsx > Javascript Test > eventInputAndChange 1`] = `
48514894
"import { NgModule } from \\"@angular/core\\";
48524895
import { CommonModule } from \\"@angular/common\\";
@@ -13433,6 +13476,53 @@ export class MyComponentModule {}
1343313476
"
1343413477
`;
1343513478

13479+
exports[`Angular with manually creating and handling class properties as bindings (more stable) > jsx > Typescript Test > escapeQuotesInnerHTML 1`] = `
13480+
"/**
13481+
useMetadata:
13482+
{\\"angular\\":{\\"changeDetection\\":\\"OnPush\\"}}
13483+
*/
13484+
13485+
import { NgModule } from \\"@angular/core\\";
13486+
import { CommonModule } from \\"@angular/common\\";
13487+
13488+
import { Component, ChangeDetectionStrategy } from \\"@angular/core\\";
13489+
import { DomSanitizer } from \\"@angular/platform-browser\\";
13490+
13491+
export interface MyComponentProps {
13492+
text?: string;
13493+
}
13494+
13495+
@Component({
13496+
selector: \\"my-component\\",
13497+
template: \`
13498+
<div
13499+
[innerHTML]='sanitizer.bypassSecurityTrustHtml(\\\\\`<link href=\\"https://fonts.googleapis.com/css2?family=Inter&display=swap\\" rel=\\"stylesheet\\">
13500+
<script src=\\"URL_1\\" defer></script>
13501+
<script src=\\"URL_2\\"></script>\\\\\`)'
13502+
></div>
13503+
\`,
13504+
changeDetection: ChangeDetectionStrategy.OnPush,
13505+
styles: [
13506+
\`
13507+
:host {
13508+
display: contents;
13509+
}
13510+
\`,
13511+
],
13512+
})
13513+
export default class MyComponent {
13514+
constructor(protected sanitizer: DomSanitizer) {}
13515+
}
13516+
13517+
@NgModule({
13518+
declarations: [MyComponent],
13519+
imports: [CommonModule],
13520+
exports: [MyComponent],
13521+
})
13522+
export class MyComponentModule {}
13523+
"
13524+
`;
13525+
1343613526
exports[`Angular with manually creating and handling class properties as bindings (more stable) > jsx > Typescript Test > eventInputAndChange 1`] = `
1343713527
"import { NgModule } from \\"@angular/core\\";
1343813528
import { CommonModule } from \\"@angular/common\\";

0 commit comments

Comments
 (0)