Skip to content

Instantly share code, notes, and snippets.

@ryanhanwu
Created October 20, 2015 15:12
Show Gist options
  • Select an option

  • Save ryanhanwu/c41f76b207956f7ff10f to your computer and use it in GitHub Desktop.

Select an option

Save ryanhanwu/c41f76b207956f7ff10f to your computer and use it in GitHub Desktop.
Get all Template Instance of your Meteor application page -
getAllTempalteInstances()
function getAllTempalteInstances(){
function walkTheDOM(node, func) {
func(node);
node = node.firstChild;
while (node) {
walkTheDOM(node, func);
node = node.nextSibling;
}
}
var instances = [];
walkTheDOM(document.body, function(node) {
try{
instances.push(Blaze.getView(node).templateInstance().view.name);
} catch(err){
console.error(err)
}
});
return _.uniq(instances)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment