Jquery only working in window.onload=function()
<p>I'm using the angular-fullstack yeoman generator in my project.</p>

<p>It contains Jquery by default. </p>

<p><code>&lt;script src="bower_components/jquery/dist/jquery.js"&gt;&lt;/script&gt;</code> is correctly inside the index.html</p>

<p>Curiously, in my js file, Jquery works perfectly inside this:</p>

<pre><code>window.onload=function() {
  //my jquery code working here
    }
</code></pre>

<p>But, it doesn't work at all if I put in this instead :</p>

<pre><code>$(document).ready(function() {
  // my code is not working here :(
});
</code></pre>

<p>And from there, I'm getting some trouble. When I switch from a page to an another one, Jquery stopped. I need to refresh the page to keep Jquery working.</p>

<p>I might not have this problem if my Jquery code was inside <code>$(document).ready(function()</code></p>

<p>As I'm using angular-fullstack generator which already makes almost every thing in my project, I don't know where I need to make some change to make it works ..</p>

<p>Any suggestion ? Thanks a lot. :)</p>