registerDirectives method

void registerDirectives(
  1. CompileElement element,
  2. List<Expression> directives
)

Registers any directives on element with the Inspector.

Implementation

void registerDirectives(
  CompileElement element,
  List<o.Expression> directives,
) {
  if (directives.isEmpty) {
    return;
  }
  _createMethod.addStmt(
    o.IfStmt(o.importExpr(DevTools.isDevToolsEnabled), [
      for (final directive in directives)
        o.importExpr(DevTools.inspector).callMethod('registerDirective', [
          element.renderNode.toReadExpr(),
          directive,
        ]).toStmt(),
    ]),
  );
}