Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@podefr
Created October 21, 2012 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podefr/3928740 to your computer and use it in GitHub Desktop.
Save podefr/3928740 to your computer and use it in GitHub Desktop.
issue #8 Olives
<!DOCTYPE html>
<html>
<head>
<title>Olives experiments</title>
</head>
<body>
<div class="doStuffHere">
<p data-model="bind: show, stuff"></p>
</div>
<script src="lib/require.js"></script>
<script src="lib/Emily.min.js"></script>
<script src="lib/Olives.min.js"></script>
<script>
require(['Olives/OObject', 'Store', 'Olives/Model-plugin'], function (OObject, Store, ModelPlugin) {
var TestUI = function TestUIConstructor() {
var store = new Store,
testUI = new OObject(store);
testUI.plugins.add("model", new ModelPlugin(store, {
show: function (args) {
console.log(args);
}
}));
return testUI;
};
test = new TestUI;
test.alive(document.querySelector(".doStuffHere"));
test.model.set('stuff', ['boogie', 'all', 'night']);
test.model.set('stuff', ['boogie', 'all', 'night']);
test.model.update('stuff', ['boogie', 'all', 'night']);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment