MCPcopy Index your code
hub / github.com/angular/angular-cli / getComponentTemplate

Function getComponentTemplate

packages/schematics/angular/app-shell/index.ts:68–83  ·  view source on GitHub ↗
(host: Tree, compPath: string, tmplInfo: TemplateInfo)

Source from the content-addressed store, hash-verified

66}
67
68function getComponentTemplate(host: Tree, compPath: string, tmplInfo: TemplateInfo): string {
69 let template = '';
70
71 if (tmplInfo.templateProp) {
72 template = tmplInfo.templateProp.getFullText();
73 } else if (tmplInfo.templateUrlProp) {
74 const templateUrl = (tmplInfo.templateUrlProp.initializer as ts.StringLiteral).text;
75 const dir = dirname(compPath);
76 const templatePath = join(dir, templateUrl);
77 try {
78 template = host.readText(templatePath);
79 } catch {}
80 }
81
82 return template;
83}
84
85function getBootstrapComponentPath(host: Tree, mainPath: string): string {
86 let bootstrappingFilePath: string;

Callers 1

validateProjectFunction · 0.85

Calls 3

joinFunction · 0.85
readTextMethod · 0.65
dirnameFunction · 0.50

Tested by

no test coverage detected