Last active
March 19, 2018 21:04
-
-
Save alexzuza/684a227e05269855090efc1e2582b5cc to your computer and use it in GitHub Desktop.
DI view parent element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* for component views, this is the host element. | |
* for embedded views, this is the index of the parent node | |
* that contains the view container. | |
*/ | |
export function viewParentEl(view: ViewData): NodeDef|null { | |
const parentView = view.parent; | |
if (parentView) { | |
return view.parentNodeDef !.parent; | |
} else { | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment