When my app starts for the very first time only, I want to execute some code.
Do you have a code sample that shows how to do this with Ionic?
When my app starts for the very first time only, I want to execute some code.
Do you have a code sample that shows how to do this with Ionic?
Actually you don’t need any specific stuff in ionic. Just use some value stored into localStorage and check it somewhere in the app.run().
angular.module('myApp').run(function(){
if (window.localStorage && !window.localStorage.getItem('firstRunFinished')) {
// DO HERE WHAT YOU WANT TO DO ON THE FIRST RUN
// ....
// now store value into localStorage
window.localStorage.setItem('firstRunFinished',true);
}
});