Just started with F7 and trying to figure out how to set a global variables that can be used for all my pages. This is what I have so far and it is not working:
My app.js has this:
var app = new Framework7({
on: {
init: function () { //sqllite.initialize()
},
pageInit: function () {
console.log(‘Page initialized’)
},
},
root: ‘#app’, // App root element
id: ‘io.framework7.testapp’, // App bundle ID
name: ‘Framework7’, // App name
theme: ‘auto’, // Automatic theme detection
// App root data
data: function () {
return {
code: ‘111’,
};
},
// App root methods
methods: {
helloWorld: function () {
app.dialog.alert(‘Hello World!’);
},
},
// App routes
routes: routes,
});
How can I use the global ‘code’ throughout my pages?