Add new class to body if url contains


#1

Hello everyone,

I’m new here and have directly a question… i’ll try to add a new class to my body-tag if the url contains a specific word like in javascript:

if (window.location.href == "games") {  
   document.getElementById("lobby-head").style.display="none";
}
else {
   document.getElementById("lobby-head").style.display="block";
}

someone has an idea how it works with ember? I would be very grateful for your help!

Thanks and nice regards, Aviana


#2

Emberis url driven…so whenever the url changes your respective route function will be called,there you can apply the same logic to get the required results.


#3

hmm sry I am a newbie in ember … can you explain me this in more detail?