Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello friends
how is possible to obtain actual View name in JS?
thank you for every post.
Tomas
Solved! Go to Solution.
You should be able to use the window.location.hash property to find this, along these lines:
var viewname = window.location.hash.substring(2);
You should be able to use the window.location.hash property to find this, along these lines:
var viewname = window.location.hash.substring(2);
Hello ClayHelberg
Thank you much again. This syntax is exactly what I need.
It works really fine for both - 2D and 3D Views.
I tried to put window and window.location to console.log() and I was really suprised how much information I can obtain. This is really inspirative for me.
Regards
Tomas
PS: for the final recap:
/**
* Function return name of active View.
*
* @return (String) - view name.
*/
$scope.getViewName = function() {
var name = window.location.hash.substring(2);
console.log(name);
return name;
}
