visitAttr method

  1. @override
void visitAttr(
  1. AttrAst ast, [
  2. _MissingDirectiveContext? context
])
override

Implementation

@override
void visitAttr(ng.AttrAst ast, [_MissingDirectiveContext? context]) {
  if (context!.elementName.startsWith('@svg')) {
    return;
  }
  if (!(_matchedSelectorWithAttribute(
          context.skipValidationSelectors, ast.name) ||
      _registry.hasAttribute(context.elementName, ast.name) ||
      _matchesInput(context.directives, ast.name) ||
      _matchedDirectiveWithAttribute(context.selectorsGroup, ast.name) ||
      _matchedSelectorWithAttribute(
          context.matchedNgContentSelectors, ast.name) ||
      hasAttributeInAllowlist(context.elementName, ast.name) ||
      isAriaAttribute(ast.name) ||
      context.attributeDeps.contains(ast.name) ||
      _isTestAttribute(ast.name))) {
    CompileContext.current.reportAndRecover(
      BuildError.forSourceSpan(
        ast.sourceSpan,
        "Can't bind to '${ast.name}' since it isn't an input of any "
        'bound directive or a native property. Please check that the '
        'spelling is correct, or that the intended directive is included '
        "in the host component's list of directives. "
        'See more details go/skipschemavalidationfor.\n$optedOutValidator',
      ),
    );
  }
}