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

Function isValid

packages/language-service/src/attribute_completions.ts:697–715  ·  view source on GitHub ↗
(attr: string)

Source from the content-addressed store, hash-verified

695
696 // Validate that the attributes are compatible with use as a structural directive.
697 const isValid = (attr: string): boolean => {
698 // The base attribute is valid by default.
699 if (attr === baseAttr) {
700 return true;
701 }
702
703 // Non-base attributes must all be prefixed with the base attribute.
704 if (!attr.startsWith(baseAttr)) {
705 return false;
706 }
707
708 // Non-base attributes must also correspond to directive inputs.
709 if (!meta.inputs.hasBindingPropertyName(attr)) {
710 return false;
711 }
712
713 // This attribute is compatible.
714 return true;
715 };
716
717 if (!attributes.every(isValid)) {
718 continue;

Callers 1

waitForFunction · 0.50

Calls 1

Tested by

no test coverage detected