You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// main.js -> create our clock...
var baseView;
Ractive.load( 'baseView.html' ).then( function ( BaseView ) {
baseView = new BaseView({
el: 'main',
data: { datetime: new Date()}
})
});
var i= 0;
setInterval(function () {
if (i%2 == 0) console.log("tick");
else console.log("tack");
i++;
baseView.set('datetime', new Date() );
}, 1000);
baseView.html and clock.html unmodified (except for not using a Capital letter in front)
All the below will be obvious to you, but it took me a lot of time to figure out ->
issue: can you add this to the doc, so people do not have to guess/dig how it is done standalone without the Gist?
issue: I was reading about in https://github.com/ractivejs/ractive-load and tried to use variations of Ractive.load.modules.moment = moment, but in vain. Finally I just loaded it (i.e. the nodeJs-module moment) in index.html along with ractive.js. That worked! But why then "Ractive.load.modules"? Please explain and document how it should be done in my example or else which you can run stand-alone.
Otherwise great work! Thanks!!!
The text was updated successfully, but these errors were encountered:
Hi!
Have been trying to run the clock example stand alone, these are my (slightly modified) files:
<title>Ractive clock demo</title> <script src='ractive.js'></script> <script src='ractive-load.js'></script> <script src='moment.js'></script> <script type="text/javascript" src="main.js"></script>// main.js -> create our clock...
var baseView;
Ractive.load( 'baseView.html' ).then( function ( BaseView ) {
baseView = new BaseView({
el: 'main',
data: { datetime: new Date()}
})
});
var i= 0;
setInterval(function () {
if (i%2 == 0) console.log("tick");
else console.log("tack");
i++;
baseView.set('datetime', new Date() );
}, 1000);
baseView.html and clock.html unmodified (except for not using a Capital letter in front)
All the below will be obvious to you, but it took me a lot of time to figure out ->
Otherwise great work! Thanks!!!
The text was updated successfully, but these errors were encountered: