2010-02-08

Lomtiki example

I'm just trying new approaches to development on javascript
var Lomtiki = $initialize({
 type: 'module',
 name: 'Lomtiki',
 properties: [{
  name: 'version',
  value: '2.0'
 }],
 items: [{
  type: 'class',
  name: 'HelloWorld',
  constructor: {
   parameters: [{
    name: 'hello'
   }],
   handler: function(meta) {
    meta.scope.hello = meta.hello;
   }
  },
  methods: [{
   name: 'print',
   handler: function(meta) {
    console.log(meta.scope.hello);
   }
  }]
 }]
});
 
var hw = new Lomtiki.HelloWorld({
 hello: 'hello',
 listeners: {
  print$before: {
   handler: function(meta) {
    meta.scope.hello += ' world' + meta.exclamation;
   }
  }
 }
});

hw.print({
 exclamation: '!'
});

No comments:

Twitter Updates

Twitter Updates

    follow me on Twitter
    Hacker Key Creative Commons License
    2006