title: update variable in another controller in AngularJS
body: <p>okay, so I am building a web-app using angular.js. I have started to implement user authentication.</p>
  
  <p>I did this with it's own controller:</p>
  
  <pre><code>app.controller("userControl", ["$http", "share", function($http, share){
  this.login = {};
  var user = this;
  this.doLogin = function(){
      this.login.fn = "login";
      $http.post('classes/main.php', user.login).success(function(data){
          console.log(data.Error);
          if(data.Error == undefined){
              alert("Success");
              share.user = data;
              window.location.href = "#memberHome";
          }
      }); 
  }
  }]);
  </code></pre>
  
  <p>and I have a member's page with it's own controller:</p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;div id="memberHome" data-role="page" ng-controller="member-Ctrl as member"&gt;
      &lt;nav class="navbar navbar-inverse"&gt;
          &lt;div class="container-fluid"&gt;
              &lt;div class="navbar-header"&gt;
                  &lt;p class="navbar-brand" href="#"&gt;Calendar&lt;/p&gt;
              &lt;/div&gt;
              &lt;ul class="nav navbar-nav navbar-left"&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Overview&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Friends&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
  
              &lt;ul class="nav navbar-nav navbar-right"&gt;
                  &lt;li&gt;&lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-user"&gt;&lt;/span&gt; Logged in as: {{member.user.forename + " " + member.user.surname}}&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#"&gt;&lt;span class="glyphicon glyphicon-log-in"&gt;&lt;/span&gt; Log Out&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;  
      &lt;/nav&gt;
      &lt;div data-role="content"&gt;
          &lt;calendar selected="day"&gt;&lt;/calendar&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>app.controller("member-Ctrl", ["share", function(share){
  this.user=share.user;
  
  }]);
  </code></pre>
  
  <p>I need the User controller to tell the member controller the details of the new user.</p>
  
  <p>I googled this and looked at the answers of a similar question, which led me to <a href="https://egghead.io/lessons/angularjs-sharing-data-between-controllers" rel="noreferrer">This</a></p>
  
  <p>and i created a service as shown in the video:</p>
  
  <pre><code>app.service("share", function(){
      this.user = {}
  
  });
  </code></pre>
  
  <p>Now whenever i login and get redirected to the <code>memberHome</code> page, it tells me  <code>Logged in as:</code></p>
  
  <p>Can anybody see why this might be?</p>
  
  <p>I am very new to Angular, and am learning, just about, everything when I need it. </p>
  
  <p>I should probably say that i am using jQuery Mobile (for a multi-page document) and Bootstrap 3</p>