MCPcopy Index your code
hub / github.com/angular/angular / createComponentAndModule

Function createComponentAndModule

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

Source from the content-addressed store, hash-verified

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

Callers 1

bootstrap_spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…