title: update side menu with new content updated from another controller ionic
body: <p>I have side menu that shows user profile picture and username. When a user updates those information from my setting page it is not updating side menu information.</p>
  
  <p>Service Function</p>
  
  <pre><code>//My service function
  myApp.factory('User',function(Auth,dataService){
  
      var userInfo = null;
  
      return {
          getUserInfo:function(){
              if (userInfo == null){
                  var loggedIn = Auth.isLoggedIn();
                  var inputs = {auth_token:loggedIn.auth_token};
                  console.log("Input User "+JSON.stringify(inputs));
                  var promise = dataService.getUserInfo(inputs).then(function(response){
                      userInfo = response;
                      return response;
                  });
                  console.log("USERINFO IS "+ JSON.stringify(promise));
                  return promise;
              }
              return userInfo;
  
          },
          refreshUserInfo:function(){
              var loggedIn = Auth.isLoggedIn();
              var inputs = {auth_token:loggedIn.auth_token};
              console.log("Input User "+JSON.stringify(inputs));
              var promise = dataService.getUserInfo(inputs).then(function(response){
                  userInfo = response;
                  return response;
              });
  
              return promise;
          }
      };
  });
  </code></pre>
  
  <p>Side menu View </p>
  
  <pre><code> //Side menu View
  
       &lt;ion-side-menu side="left"  id="leftSideMenu" class="menu_containor" style="visibility: hidden;" drag-content="false"&gt;
  
            &lt;ion-content&gt;
                &lt;div&gt;
                    &lt;div class="about_top no_back"&gt;
  
                        &lt;div class="menu_left_img"&gt;
  
                            &lt;img src="{{userInfo.pic_url}}" width="110" height="110"&gt;
                        &lt;/div&gt;
                        &lt;!--&lt;a href="#" class="red_icon"&gt;&lt;img src="img/menu-redicon.png"  width="32"&gt;&lt;/a&gt;--&gt;
                        &lt;div class="menu_right_txt"&gt;
                            &lt;h3&gt;Hello,&lt;/h3&gt;
                            &lt;h1&gt;{{userInfo.user_firstname}}&lt;/h1&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
  
  
                &lt;/div&gt;
  
                &lt;/ion-content&gt;
  
  
    &lt;/ion-side-menu&gt;
  </code></pre>
  
  <p>Controllers: 
  Side Menu Controller</p>
  
  <pre><code>//Side Menu Controller
  appController.controller('AppCtrl', function($scope,$ionicPlatform, $ionicModal, $timeout,$state,User,definedVariable,$ionicSideMenuDelegate) {
      $ionicPlatform.ready(function() {
  
          //Get user information
          if (User.getUserInfo().length &gt; 0){
              $scope.userInfo = User.getUserInfo()[0];
  
          }else{
              User.getUserInfo().then(function(response){
                 $scope.userInfo = response[0];
  
              });
          }
  
  
  
      });
  
  })
  </code></pre>
  
  <p>Controller : Settings Controller</p>
  
  <pre><code>//Settings Controller
  
  .controller('settingsCtrl',['$scope','$stateParams','$ionicPlatform','$timeout','$ionicSideMenuDelegate','$ionicModal','Auth' ,
          '$location','$ionicActionSheet','countryList','User','definedVariable','dataService','adMobHelper',
          function($scope, $stateParams,$ionicPlatform,$timeout,$ionicSideMenuDelegate,$ionicModal,Auth,$location,$ionicActionSheet,countryList,User,definedVariable,dataService,adMobHelper) {
          $ionicPlatform.ready(function() {
  
  
              window.scope = $scope;
  
  
              $scope.userData = {};
              var user = User.getUserInfo();
              if (user.length &gt;= 0){
                  $scope.userData = user[0];
              }else{
                  user.then(function(result){
                     $scope.userData = result[0];
                  });
              }
  
  
              var modalOptions = {
  
                  updateUserAction:function(){
                      console.log(dataService.get_auth_token().auth_token);
                      var loggedIn = Auth.isLoggedIn();
                      $scope.updated.auth_token = loggedIn.auth_token;
                      if (Auth.getPicId() != null){
                          $scope.updated.pic_id = Auth.getPicId();
                      }
  
                      Auth.update_user($scope.updated).then(function(result){
  
                         if (result){
                             var promise = User.refreshUserInfo().then(function(response){
                                 $scope.modal.hide();
                             });
                             //$scope.modal.hide();
                         }else{
                             alert("Something went wrong");
                         }
                      });
  
                  },
  
              };
  
              $scope.modalActions = modalOptions;
  
              $ionicModal.fromTemplateUrl('templates/editProfile.html', {
                  scope: $scope
              }).then(function(modal) {
                  $scope.modal = modal;
              });
  
  
          });
      }])
  </code></pre>
  
  <p>Thank you in advance</p>