Skip to content

Instantly share code, notes, and snippets.

@alexzuza
Last active March 19, 2018 21:04
Show Gist options
  • Save alexzuza/684a227e05269855090efc1e2582b5cc to your computer and use it in GitHub Desktop.
Save alexzuza/684a227e05269855090efc1e2582b5cc to your computer and use it in GitHub Desktop.
DI view parent element
/**
* 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