MCPcopy
hub / github.com/angular/angular / feature

Function feature

packages/core/src/render3/features/host_directives_feature.ts:47–60  ·  view source on GitHub ↗
(definition: DirectiveDef<unknown>)

Source from the content-addressed store, hash-verified

45 rawHostDirectives: HostDirectiveConfig[] | (() => HostDirectiveConfig[]),
46) {
47 const feature: DirectiveDefFeature = (definition: DirectiveDef<unknown>) => {
48 const isEager = Array.isArray(rawHostDirectives);
49
50 if (definition.hostDirectives === null) {
51 definition.resolveHostDirectives = resolveHostDirectives;
52 definition.hostDirectives = isEager
53 ? rawHostDirectives.map(createHostDirectiveDef)
54 : [rawHostDirectives];
55 } else if (isEager) {
56 definition.hostDirectives.unshift(...rawHostDirectives.map(createHostDirectiveDef));
57 } else {
58 definition.hostDirectives.unshift(rawHostDirectives);
59 }
60 };
61 feature.ngInherit = true;
62 return feature;
63}

Callers 1

Calls 2

isArrayMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…