In my controller, I want to get a random record from the localstorage and display in the view, how can I do that?
In my config I have:
stores: ['Items']
In my function I have :
var mystore = (this.getStores())[0];
var index = this.getRandomInt(0, mystore.totalCount() -1);
var nextItem = mystore.getAt(index);
but it’s stuck at the first line
Maybe there is an easier way?
Since your store is called ‘Items’ i would:
is the most reliable way to get the instance of the store.