shimCssForNode method

void shimCssForNode(
  1. NodeReference nodeReference,
  2. int nodeIndex,
  3. CompileIdentifierMetadata nodeType
)

Implementation

void shimCssForNode(NodeReference nodeReference, int nodeIndex,
    CompileIdentifierMetadata nodeType) {
  if (isRootNodeOfHost(nodeIndex)) return;
  if (component.template!.encapsulation == ViewEncapsulation.Emulated) {
    // Set ng_content class for CSS shim.
    var shimMethod =
        nodeType != Identifiers.HTML_ELEMENT ? 'addShimC' : 'addShimE';
    o.Expression shimClassExpr =
        o.InvokeMemberMethodExpr(shimMethod, [nodeReference.toReadExpr()]);
    _createMethod.addStmt(shimClassExpr.toStmt());
  }
}