$$('.irAtexto').on('click', function(){
// ------ tomamos el "id" de la card en la que hemos hecho click.
var id = $$(this).attr('data-id');
// ------ abrimos texto.html con los datos de "id".
mainView.router.loadPage('texto.html?id='+id);
});
and append the info in the LocalStorage with this code:
myApp.onPageInit('textos', function(page){
var id = page.query.id;
$$('#titulo').append(localStorage.getItem('titulo'+id));
$$('#texto').append(localStorage.getItem('texto'+id));
And with framework7 v.2, the new routes, and so on… I don’t manage to find a simple way to do this.
Thanks for your answer. I have solved it by using the route: ‘details?id=’ + i
Where ‘i’ is the variable used for the contacts array.
Now I am facing a similar problem.
In the page contacts.html I list all the contacts by its name using the function navigator.contacts.find (it is from the plugin cordova-plugin-contacts). It works very well. And I generate a link for each contact like this:
'<a href="details?i=' + i + '" id="contacto" class="item-content item-link">'
The link works ok and opens details.html with the value within the query for ‘i’. I manage to get the ‘i’ value. But when I try to get values from contacts[i] … it doesn’t work. It seems that the object ‘contacts’ is only available while in contacts.html (the list of contacts), but when I change to details.html… I can not get anything from it.