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

Function createComponent

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

Source from the content-addressed store, hash-verified

663
664 describe('AOT-compiled components', () => {
665 function createComponent(
666 template: (rf: any) => void,
667 vars: number,
668 consts?: (number | string)[][],
669 ) {
670 class Comp {
671 static ɵfac = () => new Comp();
672 static ɵcmp = defineComponent({
673 type: Comp,
674 selectors: [['comp']],
675 decls: 1,
676 vars,
677 consts,
678 template,
679 encapsulation: 2,
680 });
681 }
682 setClassMetadata(
683 Comp,
684 [
685 {
686 type: Component,
687 args: [{selector: 'comp', template: '...'}],
688 },
689 ],
690 null,
691 null,
692 );
693 return Comp;
694 }
695
696 function createNgModule(Comp: any) {
697 class Module {

Callers 15

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

Calls 1

setClassMetadataFunction · 0.85

Tested by

no test coverage detected