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

Method appendComponentNode

packages/compiler/src/typecheck/ops/scope.ts:896–925  ·  view source on GitHub ↗
(node: Component)

Source from the content-addressed store, hash-verified

894 }
895
896 private appendComponentNode(node: Component): void {
897 // TODO(crisbeto): should we still append the children if the component is invalid?
898 // Check that the referenced class exists.
899 if (!this.tcb.boundTarget.referencedDirectiveExists(node.componentName)) {
900 this.tcb.oobRecorder.missingNamedTemplateDependency(this.tcb.id, node);
901 return;
902 }
903
904 // Check that the class is a component.
905 const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
906 if (
907 directives === null ||
908 directives.length === 0 ||
909 directives.every((dir) => !dir.isComponent || !dir.isStandalone)
910 ) {
911 this.tcb.oobRecorder.incorrectTemplateDependencyType(this.tcb.id, node);
912 return;
913 }
914
915 const opIndex = this.opQueue.push(new TcbComponentNodeOp(this.tcb, this, node)) - 1;
916 this.componentNodeOpMap.set(node, opIndex);
917 if (this.tcb.env.config.controlFlowPreventingContentProjection !== 'suppress') {
918 this.appendContentProjectionCheckOp(node);
919 }
920 this.appendInputsOfSelectorlessNode(node);
921 this.appendOutputsOfSelectorlessNode(node);
922 this.appendSelectorlessDirectives(node);
923 this.appendChildren(node);
924 this.checkAndAppendReferencesOfNode(node);
925 }
926
927 private appendDeferredBlock(block: DeferredBlock): void {
928 this.appendDeferredTriggers(block, block.triggers);

Callers 1

appendNodeMethod · 0.95

Tested by

no test coverage detected