MCPcopy Create free account
hub / github.com/angular/angular / createComponentAndModule

Function createComponentAndModule

packages/core/test/acceptance/bootstrap_spec.ts:84–112  ·  view source on GitHub ↗
(
      options: {
        encapsulation?: ViewEncapsulation;
        preserveWhitespaces?: boolean;
        selector?: string;
      } = {},
    )

Source from the content-addressed store, hash-verified

82
83 describe('options', () => {
84 function createComponentAndModule(
85 options: {
86 encapsulation?: ViewEncapsulation;
87 preserveWhitespaces?: boolean;
88 selector?: string;
89 } = {},
90 ) {
91 @Component({
92 selector: options.selector || 'my-app',
93 // styles must be non-empty to trigger `ViewEncapsulation.Emulated`
94 styles: 'span {color:red}',
95 template: '<span>a b</span>',
96 encapsulation: options.encapsulation,
97 preserveWhitespaces: options.preserveWhitespaces,
98 jit: true,
99 standalone: false,
100 })
101 class TestComponent {}
102
103 @NgModule({
104 imports: [BrowserModule],
105 declarations: [TestComponent],
106 bootstrap: [TestComponent],
107 jit: true,
108 })
109 class TestModule {}
110
111 return TestModule;
112 }
113
114 it(
115 'should use ViewEncapsulation.Emulated as default',

Callers 1

bootstrap_spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected