# j-Watcher

> Ez a komponens végrehajtja a <script type='text/js'></script> címkével meghatározott kódot.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: hu
Content-SHA256: 2bba42cd9e3653389dbdee72d82cee5876d65e4bc8349d147633230b27d3447b
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

Ez a komponens végrehajtja a `<script type="text/js"></script>` címkéjén meghatározott kódot.

```html
<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 a `datasource` tulajdonsá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.

```html example.html
<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>
```
