Skip to content

Instantly share code, notes, and snippets.

@unlocomqx
Created March 20, 2017 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unlocomqx/70accec959e41b27be51bf01c96d0b36 to your computer and use it in GitHub Desktop.
Save unlocomqx/70accec959e41b27be51bf01c96d0b36 to your computer and use it in GitHub Desktop.
function getSourceFileOfNode(node) {
while (node && node.kind !== 256 /* SourceFile */) {
if (node.text == 'NgModule'){
return node;
}
node = node.parent;
}
return node;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment