
Used to resolve resource URLs on `@Component` when used with JIT compilation. ``` @Component({ selector: 'my-comp', templateUrl: 'my-comp.html', // This requires asynchronous resolution }) class MyComponnent{ } // Calling `renderComponent` will fail because `MyComponent`'s `@Compenent.templateUrl` // needs to be resolved because `renderComponent` is synchronous process. // renderComponent(MyComponent); // Calling `resolveComponentResources` will resolve `@Compenent.templateUrl` into // `@Compenent.template`, which would allow `renderComponent` to proceed in synchronous manner. // Use browser's `fetch` function as the default resource resolution strategy. resolveComponentResources(fetch).then(() => { // After resolution all URLs have been converted into strings. renderComponent(MyComponent); }); ``` PR Close #24637
18 lines
643 B
TypeScript
18 lines
643 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {compileComponent, compileDirective} from './render3/jit/directive';
|
|
import {compileInjectable} from './render3/jit/injectable';
|
|
import {compileNgModule} from './render3/jit/module';
|
|
|
|
export const ivyEnabled = true;
|
|
export const R3_COMPILE_COMPONENT = compileComponent;
|
|
export const R3_COMPILE_DIRECTIVE = compileDirective;
|
|
export const R3_COMPILE_INJECTABLE = compileInjectable;
|
|
export const R3_COMPILE_NGMODULE = compileNgModule;
|