I want to be able to change my theme will the app is running. How I can pass the value back from backbone, but can't figure how to add it to the page div. For example, in the following code {{-theme}} is replaced by the actual value, say a.
-- <div data-role="page" id="todopage" >
-- <div data-theme="a" id="testr">{{-theme}}</span>
I want to be able to do some thing like this
<div data-role="page" id="todopage" data-theme="<%{{-theme}} %>">
. Is this possible?
I'm getting the value to theme, bu using the following code
self.setElement('#todopage')
self.elem = {
testr: self.$el.find('#testr')
}
self.tm = {
testr: _.template( self.elem.testr.html() )
}
and in the render var loaded = app.model.state.get('theme')
self.elem.testr.html( self.tm.testr({
theme: loaded
}) )
I'm not sure now to pass the value directly back to the div tag. Has anyone any ideas?
thanks mark