Show alert popup n^(th) time the app is opened

I’d like for the user to see a popup the 5th time after the app is opened. I’ve been able to successfully show a popup automatically, but how would I track the number of times the app was opened before showing the popup?

Here’s my current setup for the popup: http://codepen.io/anon/pen/LGxvoK

you can try something like:
`$localstorage.counter=$localstorage.counter||1
$localstorage.counter ++;
if ($localstorage.counter==5){
// do stuff
}

with ng-storage plugin: https://github.com/gsklee/ngStorage
`

1 Like