MCPcopy
hub / github.com/angular/angular / createComponent

Function createComponent

packages/core/test/acceptance/ng_module_spec.ts:677–706  ·  view source on GitHub ↗
(
        template: (rf: any) => void,
        vars: number,
        consts?: (number | string)[][],
      )

Source from the content-addressed store, hash-verified

675
676 describe('AOT-compiled components', () => {
677 function createComponent(
678 template: (rf: any) => void,
679 vars: number,
680 consts?: (number | string)[][],
681 ) {
682 class Comp {
683 static ɵfac = () => new Comp();
684 static ɵcmp = defineComponent({
685 type: Comp,
686 selectors: [['comp']],
687 decls: 1,
688 vars,
689 consts,
690 template,
691 encapsulation: 2,
692 });
693 }
694 setClassMetadata(
695 Comp,
696 [
697 {
698 type: Component,
699 args: [{selector: 'comp', template: '...'}],
700 },
701 ],
702 null,
703 null,
704 );
705 return Comp;
706 }
707
708 function createNgModule(Comp: any) {
709 class Module {

Callers 15

createComponentMethod · 0.90
di_graph_spec.tsFile · 0.90
constructorMethod · 0.90
reactivity_spec.tsFile · 0.90
defer_spec.tsFile · 0.90
openModalMethod · 0.90
internal_spec.tsFile · 0.90
createMethod · 0.90
createComponentMethod · 0.90

Calls 1

setClassMetadataFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…