title: Clear $scope on logout in Angular js
body: <p>In my controller I am storing data as <code>$scope.$parent.dossierSummaries = data;</code>
  but after log out and login the application <code>$scope.$parent.dossierSummaries</code> retains the same old data.</p>
  
  <p>I am doing this on log out </p>
  
  <pre><code>.success( function( response, status ) {
      if ( response.status &gt; 0 ) {
          var u = $rootScope.user.username;
          $cookieStore.remove('myapp');
          $rootScope.user = { username: '', role: 0 };
          success(u);
      }
      else {
          error(response.messages);
      }
  })
  .error( function( response, status ) {
      error(['There was an error logging you out.']);
  });
  </code></pre>