Javascript isn’t really my forte but I’m moving forward, but I wanted to share some stuff in the app.data object . What moronic thing am I doing wrong?
Hi @nolimits4web I tried the way you have mentioned in JS Fiddle but when I am trying to access the same in any HTML template I am getting error that data is not defined.
I tried accessing with these ways in HTML within template7
{{$root.data.imgsrc}}
{{$app.data.imgsrc}}
{{app.data.imgsrc}}
But every line game me same error.
Can you give a fiddle for accessing same value in HTML template.
Hi @Bruno_Giubilei thank you for your response, I am able to get it in data function on the template page but I am not able to return it to HTML template where I want to show it.
You need to learn how Template7 works http://idangero.us/template7/
If you do something inside of {{#each}} then it is in different context, then it should be {{../$root.imgsrc}}
I have the same problem. I will try to explain what I think it’s happening looking at F7 source code.
Property data is created on init() function, that in case of used with Cordova device, waits to be called when event deviceready is launched by system.
In my case, when I try to use app.data inmediateley after var f7App = new Framework7(…), I get the same error. So I have to use constructor param initOnDeviceReady:false