Change of value isn´t persistent between controllers
<p>I´m trying to store some kind of global variable in my application. I read that it´s best practice to use a value instead of a service or a rootscope.<br>
So I created this code snippet to test the behavior of the value. It seems that the value changes indside of the controller but if I use the value in another controller, the change seems to be lost.
Is there a way to change the value during runtime and why is the change not persistant ?</p>

<p><a href="http://jsfiddle.net/Lvc0u55v/6444/" rel="nofollow">Here</a> is my code on jsfiddle</p>

<p><strong>Javascript</strong></p>

<pre><code>var myApp = angular.module('myApp',[]);

myApp.value("basePath", "");

myApp.controller('TestController', function($scope, basePath) {

    $scope.preEdit = basePath;

  basePath = window.location.href;
  $scope.postEdit = basePath;

});

myApp.controller('SampleController', function($scope, basePath) {
    $scope.transferedValue = basePath;
})
</code></pre>

<hr>

<p><strong>HTML:</strong></p>

<pre><code>&lt;div ng-controller="TestController"&gt;
 Before Editing: {{preEdit}}&lt;br&gt;
 After Editing: {{postEdit}}&lt;br&gt;
&lt;/div&gt;

&lt;div ng-controller="SampleController"&gt;
  In another Controller: {{transferedValue}}
&lt;/div&gt;
</code></pre>