j-Watcher
Ez a komponens végrehajtja a <script type="text/js"></script> címkéjén meghatározott kódot.
<script type="text/js">
// value {Object} a value bound according to the path
// path {String} a path where the value was bonded
// type {Number} binding type (0: init, 1: manually, 2: by input, 3: default value)
// element {jQuery element} a current element
// datasource {Object}
// component {jComponent}
</script>konfiguráció:
delay {Number}egy késés az értékelési kód (default:0)- NEW:
datasource {String}egy link az adatforráshoz (ez adatasourcetulajdonságban kerül tárolásra)
Fontos:
Használnod kell <script type="text/js"> vagy <script type="text/plain">Ne használja a forgatókönyvet elem nélkül type vagy a típus text|application/javascript A böngésző automatikusan értékeli a forgatókönyvet.
Használja a <ui-component name="watcher">Amennyiben a készülék még nem tölthető le, jComponent letöltés az első felhasználásra a címről DEF.fallback (Azt a Componentator A szerző: Peter Širka. forrás: a Componentator Az összetevők raktár, MIT licenc.
<ui-component name="watcher" path="common.value">
<script type="text/js">
console.log('-->', value, path, type);
element.html(value);
</script>
</ui-component>
<script>
var common = { value: 'init' };
setInterval(function() {
SET('common.value', new Date().format('HH:mm:ss'));
}, 1000);
</script>