MCPcopy
hub / github.com/angular/angular-cli / validateProject

Function validateProject

packages/schematics/angular/app-shell/index.ts:123–136  ·  view source on GitHub ↗
(mainPath: string)

Source from the content-addressed store, hash-verified

121// end helper functions.
122
123function validateProject(mainPath: string): Rule {
124 return (host: Tree) => {
125 const routerOutletCheckRegex = /<router-outlet.*?>([\s\S]*?)(?:<\/router-outlet>)?/;
126
127 const componentPath = getBootstrapComponentPath(host, mainPath);
128 const tmpl = getComponentTemplateInfo(host, componentPath);
129 const template = getComponentTemplate(host, componentPath, tmpl);
130 if (!routerOutletCheckRegex.test(template)) {
131 throw new SchematicsException(
132 `Prerequisite for application shell is to define a router-outlet in your root component.`,
133 );
134 }
135 };
136}
137
138function getMetadataProperty(metadata: ts.Node, propertyName: string): ts.PropertyAssignment {
139 const properties = (metadata as ts.ObjectLiteralExpression).properties;

Callers 1

index.tsFile · 0.85

Calls 3

getComponentTemplateInfoFunction · 0.85
getComponentTemplateFunction · 0.85

Tested by

no test coverage detected