AngularFire change reference in factory when routeParameter changes
<p>I am currently working on an angular app with firebase (using angularFire) with a lot of factories providing firebase arrays and objects.</p>

<p>I need to change the references of all factorys multiple times in a session whenever the route parameter "element_id" changes but angularjs loads all the factories once they are first called and I don't see a way to update the reference after this initial call.</p>

<p>I've tried reloading the app using</p>

<pre><code>$route.reload();
</code></pre>

<p>which changed nothing and</p>

<pre><code>$window.location.reload();
</code></pre>

<p>which either caused error 404 because this page is not available in html5 mode localhost:8000/element1 is not existing or took me back to localhost:8000 without my element_id when I wasn't using html5 mode.</p>

<p>Here's one of my factories with my root firebase factory:</p>

<pre><code>app.factory("fireroot", function(){
  var reference = new Firebase("https://mybase.firebaseio.com");
  return reference;
});

app.factory('core_data', function($firebaseObject, fireroot, $routeParams) {
  var reference = fireroot.child("elements").child($routeParams.element_id).child("core-data");
  var core_data = $firebaseObject(reference);

  return core_data;
});
</code></pre>

<p>Thanks a lot for your help, I only made my past years of coding thanks to this community, finally it's time to actively participate :).</p>