feat(ivy): add element instruction (#23899)

Adds a simplified element instruction that can be used if an element
has no children.

PR Close #23899
This commit is contained in:
Ben Lesh
2018-05-25 16:23:00 -07:00
committed by Victor Berchet
parent d6989c80d3
commit b415010222
13 changed files with 117 additions and 78 deletions

View File

@ -28,6 +28,7 @@ export {
NC as ɵNC,
C as ɵC,
E as ɵE,
Ee as ɵEe,
L as ɵL,
T as ɵT,
V as ɵV,

View File

@ -50,6 +50,7 @@ export {
elementEnd as e,
elementProperty as p,
elementStart as E,
element as Ee,
elementStyle as s,
elementStyleNamed as sn,

View File

@ -1032,6 +1032,15 @@ export function elementEnd() {
queueLifecycleHooks(previousOrParentNode.tNode.flags, currentView);
}
/** Marks the beginning and end of an element in one call. */
export function element(
index: number, name: string, attrs?: TAttributes | null | undefined,
localRefs?: string[] | null | undefined): RElement {
const relement = elementStart(index, name, attrs, localRefs);
elementEnd();
return relement;
}
/**
* Updates the value of removes an attribute on an Element.
*

View File

@ -12,6 +12,7 @@ import {assertNotNull} from './assert';
import {AttributeMarker, TAttributes, TNode, unusedValueExportToPlacateAjd as unused1} from './interfaces/node';
import {CssSelector, CssSelectorList, NG_PROJECT_AS_ATTR_NAME, SelectorFlags, unusedValueExportToPlacateAjd as unused2} from './interfaces/projection';
const unusedValueToPlacateAjd = unused1 + unused2;
function isCssClassMatching(nodeClassAttrVal: string, cssClassToMatch: string): boolean {