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

Function buildSelector

packages/schematics/angular/directive/index.ts:19–28  ·  view source on GitHub ↗
(options: DirectiveOptions, projectPrefix: string)

Source from the content-addressed store, hash-verified

17import { Schema as DirectiveOptions } from './schema';
18
19function buildSelector(options: DirectiveOptions, projectPrefix: string) {
20 let selector = options.name;
21 if (options.prefix) {
22 selector = `${options.prefix}-${selector}`;
23 } else if (options.prefix === undefined && projectPrefix) {
24 selector = `${projectPrefix}-${selector}`;
25 }
26
27 return strings.camelize(selector);
28}
29
30const directiveSchematic: RuleFactory<DirectiveOptions> = createProjectSchematic(
31 (options, { project, tree }) => {

Callers 1

index.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected