feat(ivy): add basic support for ng-container (#25227)

This commit adds basic support for <ng-container> - most of the
functionality should work as long as <ng-container> is a child of
a regular element.

PR Close #25227
This commit is contained in:
Pawel Kozlowski
2018-07-26 17:22:41 +02:00
committed by Kara Erickson
parent 4f741e74e1
commit 28c7a4efbc
9 changed files with 236 additions and 26 deletions

View File

@ -11,7 +11,7 @@ import {ElementRef} from '../../linker/element_ref';
import {TemplateRef} from '../../linker/template_ref';
import {ViewContainerRef} from '../../linker/view_container_ref';
import {LContainerNode, LElementNode} from './node';
import {LContainerNode, LElementContainerNode, LElementNode} from './node';
export interface LInjector {
/**
@ -26,7 +26,7 @@ export interface LInjector {
* for DI to retrieve a directive from the data array if injector indicates
* it is there.
*/
readonly node: LElementNode|LContainerNode;
readonly node: LElementNode|LElementContainerNode|LContainerNode;
/**
* The following bloom filter determines whether a directive is available

View File

@ -21,11 +21,12 @@ import {LViewData, TView} from './view';
* on how to map a particular set of bits in LNode.flags to the node type.
*/
export const enum TNodeType {
Container = 0b00,
Projection = 0b01,
View = 0b10,
Element = 0b11,
ViewOrElement = 0b10,
Container = 0b000,
Projection = 0b001,
View = 0b010,
Element = 0b011,
ViewOrElement = 0b010,
ElementContainer = 0b100,
}
/**
@ -118,6 +119,13 @@ export interface LElementNode extends LNode {
readonly data: LViewData|null;
}
/** LNode representing <ng-container>. */
export interface LElementContainerNode extends LNode {
/** The DOM comment associated with this node. */
readonly native: RComment;
readonly data: null;
}
/** LNode representing a #text node. */
export interface LTextNode extends LNode {
/** The text node associated with this node. */