docs/vendor.js
function canInsertNativeNode(parent, currentView) {
    // We can only insert into a Component or View. Any other type should be an Error.
    ngDevMode && assertNodeOfPossibleTypes(parent, 3 /* Element */, 2 /* View */);
    if (parent.tNode.type === 3 /* Element */) {
        // Parent is an element.
        if (parent.view !== currentView) {
            // If the Parent view is not the same as current view than we are inserting across
            // Views. This happens when we insert a root element of the component view into
            // the component host element and it should always be eager.
            return true;
        }
        // Parent elements can be a component which may have projection.
        if (parent.data === null) {
            // Parent is a regular non-component element. We should eagerly insert into it
            // since we know that this relationship will never be broken.
            return true;
        }
        else {
            // Parent is a Component. Component's content nodes are not inserted immediately
            // because they will be projected, and so doing insert at this point would be wasteful.
            // Since the projection would than move it to its final destination.
            return false;
        }
    }
    else {
        // Parent is a View.
        ngDevMode && assertNodeType(parent, 2 /* View */);
        // Because we are inserting into a `View` the `View` may be disconnected.
        var grandParentContainer = getParentLNode(parent);
        if (grandParentContainer == null) {
            // The `View` is not inserted into a `Container` we have to delay insertion.
            return false;
        }
        ngDevMode && assertNodeType(grandParentContainer, 0 /* Container */);
        if (grandParentContainer.data[RENDER_PARENT] == null) {
            // The parent `Container` itself is disconnected. So we have to delay.
            return false;
        }
        else {
            // The parent `Container` is in inserted state, so we can eagerly insert into
            // this location.
            return true;
        }
    }
}
function canInsertNativeNode(parent, currentView) {
    // We can only insert into a Component or View. Any other type should be an Error.
    ngDevMode && assertNodeOfPossibleTypes(parent, 3 /* Element */, 2 /* View */);
    if (parent.tNode.type === 3 /* Element */) {
        // Parent is an element.
        if (parent.view !== currentView) {
            // If the Parent view is not the same as current view than we are inserting across
            // Views. This happens when we insert a root element of the component view into
            // the component host element and it should always be eager.
            return true;
        }
        // Parent elements can be a component which may have projection.
        if (parent.data === null) {
            // Parent is a regular non-component element. We should eagerly insert into it
            // since we know that this relationship will never be broken.
            return true;
        }
        else {
            // Parent is a Component. Component's content nodes are not inserted immediately
            // because they will be projected, and so doing insert at this point would be wasteful.
            // Since the projection would than move it to its final destination.
            return false;
        }
    }
    else {
        // Parent is a View.
        ngDevMode && assertNodeType(parent, 2 /* View */);
        // Because we are inserting into a `View` the `View` may be disconnected.
        var grandParentContainer = getParentLNode(parent);
        if (grandParentContainer == null) {
            // The `View` is not inserted into a `Container` we have to delay insertion.
            return false;
        }
        ngDevMode && assertNodeType(grandParentContainer, 0 /* Container */);
        if (grandParentContainer.data[RENDER_PARENT] == null) {
            // The parent `Container` itself is disconnected. So we have to delay.
            return false;
        }
        else {
            // The parent `Container` is in inserted state, so we can eagerly insert into
            // this location.
            return true;
        }
    }
}
function canInsertNativeNode ( parent , currentView ) { // We can only insert into a Component or View. Any other type should be an Error. ngDevMode && assertNodeOfPossibleTypes ( parent , 3 /* Element */ , 2 /* View */ ) ; if ( parent . tNode . type === 3 /* Element */ ) { // Parent is an element. if ( parent . view !== currentView ) { // If the Parent view is not the same as current view than we are inserting across // Views. This happens when we insert a root element of the component view into // the component host element and it should always be eager. return true ; } // Parent elements can be a component which may have projection. if ( parent . data === null ) { // Parent is a regular non-component element. We should eagerly insert into it // since we know that this relationship will never be broken. return true ; } else { // Parent is a Component. Component's content nodes are not inserted immediately // because they will be projected, and so doing insert at this point would be wasteful. // Since the projection would than move it to its final destination. return false ; } } else { // Parent is a View. ngDevMode && assertNodeType ( parent , 2 /* View */ ) ; // Because we are inserting into a `View` the `View` may be disconnected. var grandParentContainer = getParentLNode ( parent ) ; if ( grandParentContainer == null ) { // The `View` is not inserted into a `Container` we have to delay insertion. return false ; } ngDevMode && assertNodeType ( grandParentContainer , 0 /* Container */ ) ; if ( grandParentContainer . data [ RENDER_PARENT ] == null ) { // The parent `Container` itself is disconnected. So we have to delay. return false ; } else { // The parent `Container` is in inserted state, so we can eagerly insert into // this location. return true ; } } }
Returns whether a native element can be inserted into the given parent.

There are two reasons why we may not be able to insert a element immediately.
- Projection: When creating a child content element of a component, we have to skip the
insertion because the content of a component will be projected.
`<component><content>delayed due to projection</content></component>`
- Parent container is disconnected: This can happen when we are inserting a view into
parent container, which itself is disconnected. For example the parent container is part
of a View which has not be inserted or is mare for projection but has not been inserted
into destination.



@param parent The parent where the child will be inserted into.
@param currentView Current LView being processed.
@return boolean Whether the child should be inserted now (or delayed until later).
Returns whether a native element can be inserted into the given parent .