main.js 631 B

123456789101112131415161718192021
  1. // Application entry point.
  2. function init() {
  3. var template = '<div bindings="event:klik:click">' +
  4. '<div><img bindings="prop:image:src"/></div>' +
  5. '<div bindings="ref:helloNode,prop:message:textContent"></div>' +
  6. '</div>';
  7. var fragment = Fragment.create(template, {
  8. klik: function() {
  9. this.prop("message", "I was clicked!");
  10. },
  11. image: "Icon.png",
  12. message: "Hello World!"
  13. }, document.body);
  14. fragment.prop("message", "Moi Maailma!");
  15. console.dir(fragment);
  16. //Fragment.destroy(fragment);
  17. }