Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Controller runs before .run

$
0
0

@obenavidez wrote:

Hello i have this issue, i declare a localstorage variable like this:

.run(function($ionicPlatform, $rootScope, $localstorage) {
  $ionicPlatform.ready(function() {
    
    $localstorage.setObject('global', {
        urlService: "http://www.url-to-go.com/",
        rangoDistancia:  0.089831
        });


    if (window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);

    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }
  });
})

it supose when first run and when the platform is ready set the variable, then the controller can read the value, but is empty, i need to close the app and open again and then the values are set, please if some one can tell me what i'm doing wrong, thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>