UNPKG

toloframework

Version:

Javascript/HTML/CSS compiler for Firefox OS or nodewebkit apps using modules in the nodejs style.

48 lines (39 loc) 1.46 kB
/** @module test */require( 'test', function(require, module, exports) { var _=function(){var D={"en":{},"fr":{}},X=require("$").intl;function _(){return X(D,arguments);}_.all=D;return _}(); // Code behind. "use strict"; var PM = require("tfw.binding.property-manager"); var List = require("tfw.binding.list"); var Link = require("tfw.binding.link"); exports.start = function() { var lst1 = new List( [1,2] ); var lst2 = new List( [3,4] ); var obj1 = {}; var obj2 = {}; PM( obj1 ).create( "list", { init: lst1 } ); PM( obj2 ).create( "list", { init: lst2 } ); new Link({ A: { obj:obj1, name:'list' }, B: { obj:obj2, name:'list' } }); obj1.list.push( 10 ); console.info("[test] obj1.list.slice()=", obj1.list.slice()); console.info("[test] obj2.list.slice()=", obj2.list.slice()); obj1.list.push( 11 ); console.info("[test] obj1.list.slice()=", obj1.list.slice()); console.info("[test] obj2.list.slice()=", obj2.list.slice()); obj2.list.push( 12 ); console.info("[test] obj1.list.slice()=", obj1.list.slice()); console.info("[test] obj2.list.slice()=", obj2.list.slice()); obj1.list.push( 13 ); console.info("[test] obj1.list.slice()=", obj1.list.slice()); console.info("[test] obj2.list.slice()=", obj2.list.slice()); }; module.exports._ = _; /** * @module test * @see module:$ * @see module:tfw.binding.property-manager * @see module:tfw.binding.list * @see module:tfw.binding.link */ });