---
title: Migrar desde jComponent 19
project: jComponent V20
version: 20.015
section: guides
language: es
license: MIT
url: https://totaljs.es/docs/es/jcomponent-v20/20-015/guides/migrating-from-v19/
updated: 2026-11-22T18:42:02.302Z
---

# Migrar desde jComponent 19

> Sustituye cada API eliminada o modificada de jComponent 19 por su equivalente en jComponent 20, incluidos los cambios que fallan sin dar ningún error.

Esta guía lleva una aplicación de jComponent 19 a jComponent 20.015. Muestra el sustituto de cada función, atributo y ajuste que se ha eliminado o modificado, y señala los cambios que no dan ningún error en la consola del navegador, porque son los que se escapan en una prueba rápida.

## Actualiza los archivos del CDN

Sustituye los dos archivos. El paquete sigue incluyendo jQuery, Tangular y las funciones de enrutamiento, así que no hace falta cargar nada más.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `https://cdn.componentator.com/spa.min@19.js` | `https://cdn.componentator.com/spa.min@20.js` |
| `https://cdn.componentator.com/spa.min@19.css` | `https://cdn.componentator.com/spa.min@20.css` |

## Orden de trabajo recomendado

1. Sustituye los archivos del CDN y abre la aplicación con la consola del navegador visible.
2. Cambia primero el marcado: los elementos `data---`, `data-bind` y `data-scope` se ignoran, así que no puedes probar nada más hasta convertirlos.
3. Busca en el código los patrones de [Cambios que fallan en silencio](#changes-that-fail-silently) y corrígelos. La consola no te los señala.
4. Corrige los errores que indica la consola, como `VALID is not defined` o `$(...).scope is not a function`.
5. Adapta los formularios y prueba cada uno a mano: vacío, no válido, válido y después de un reinicio.
6. Prueba las pantallas que cargan datos, porque los callbacks de AJAX reciben menos argumentos.

## Cambios que fallan en silencio

Cada uno de estos casos se ejecuta sin errores en 20.015 y hace algo incorrecto. Busca en tu código lo que aparece en la columna izquierda.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `WATCH('user.name', function(path, value, type) {` | `WATCH('user.name', function(value, flags, path) {` |
| `WATCH('user.*', function(path) {` | `WATCH('user', function(value, flags, path) {` |
| `RESET('form.*');` | `RESET('form');` |
| `GET('form @modified')` | `COMPONENTS('form @modified')` |
| `return value; // a non-empty string means valid` | `return !!value;` |
| `self.setter = function(value, path, type) {` | `self.setter = function(value, path, flags) {` |
| `SET('user.name', 'Ann', 100);` | `setTimeout(() => SET('user.name', 'Ann'), 100);` |
| `SET('form.city', 'Vienna', true);` | `SET('form.city @reset', 'Vienna');` |
| `PUSH('cart.items', [2, 3]);` | `[2, 3].forEach(item => PUSH('cart.items', item));` |
| `SETTER('box', 'show', 1);` | `SETTER('box/show', 1);` |
| `FIND('box', function(com) {` | `WAIT(() => FIND('box'), function() {` |
| `<div data---="box__user.name__size:2"></div>` | `<ui-component name="box" path="user.name" config="size:2"></ui-component>` |
| `<ui-plugin path="address">` | `<ui-plugin path="?.address">` |
| `config="text;format:2"` | `config="text:value.format(2)"` |
| `AJAX('GET /orders/', function(response, err) {` | `ON('response', opt => status = opt.status);` |

Una declaración `PLUGIN()` sin un elemento `<ui-plugin>` también deja de ejecutarse. Consulta [Scopes y plugins](#scopes-and-plugins).

## Formularios y validación

`VALID()`, `CAN()`, `DISABLED()`, `INVALID()`, `CHANGE()`, `MODIFIED()` y `DEFAULT()` se han eliminado. Lee el estado de un formulario con `COMPONENTS()` y `ERRORS()`, y cámbialo con flags. [Formularios y validación](../forms/) describe la nueva forma de trabajar.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `VALID('form.*')` | `COMPONENTS('form @invalid').length === 0` |
| `CAN('form.*')` | `can('form')` (la función de más abajo) |
| `DISABLED('form.*')` | `!can('form')` |
| `ERRORS('form.*')` | `ERRORS('form @touched', list => console.log(list.length))` |
| `CHANGE('form.*');` | `UPD('form @change');` |
| `CHANGE('form.*', false);` | `RESET('form');` |
| `MODIFIED('form.*')` | `COMPONENTS('form @modified').map(com => com.path.toString())` |
| `DEFAULT('filter.*');` | `SET('filter @default', {});` |
| `INVALID('form.name');` | `COMPONENTS('form.name').forEach(com => com.reconfigure({ touched: 1, invalid: true }));` |
| `RESET('form.*');` | `RESET('form');` |

`CAN()` no tiene un sustituto directo, así que mantén una pequeña función en tu aplicación:

```js
function can(path) {
	return COMPONENTS(path + ' @invalid').length === 0 && COMPONENTS(path + ' @touched').length > 0;
}
```

**`ERRORS()` recibe un callback.** Sin él lanza `r is not a function`. En 19 devolvía los campos tocados y no válidos. En 20 pasa todos los campos no válidos, así que añade el flag `@touched` para conservar el resultado anterior:

```js
ERRORS('form @touched', list => console.log(list.length)); // 0
SET('form.name @change', '');
ERRORS('form @touched', list => console.log(list.map(com => com.path.toString()))); // ["form.name"]
```

**Los paths ya no admiten `.*`.** No coincide con nada y no se muestra ningún error. `ERRORS()` indica entonces que un formulario roto es válido:

```js
ERRORS('form.*', list => console.log(list.length)); // 0
ERRORS('form', list => console.log(list.length)); // 1
```

**`GET('form @modified')` devuelve el modelo completo** en 20. Recoge tú mismo los campos modificados:

```js
SET('form.city @change', 'Prague');

var changed = {};
COMPONENTS('form @modified').forEach(com => changed[com.path.toString().split('.').pop()] = com.get());
console.log(changed); // {"city":"Prague"}
```

**El resultado de `self.validate` se interpreta de otra manera.** En 19, cualquier valor truthy era válido. En 20, una cadena no vacía es un mensaje de error, así que un validador que devuelve el valor marca como no válido un campo relleno. Un número como `value.length` tampoco es válido. Devuelve un booleano:

```js
self.validate = function(value) {
	return !!value;
};
```

```js
self.validate = function(value) {
	return value.length > 0;
};
```

`self.validate` también ha perdido su segundo argumento, `init`. Mantén tu propio flag cuando la primera ejecución necesite un tratamiento distinto:

```js
COMPONENT('field', function(self, config) {
	var init = true;
	self.validate = function(value) {
		console.log(init);
		init = false;
		return true;
	};
});
```

### Enlazar un input

El atributo `data-jc-bind` se ignora, así que el input no escribe en el modelo. Llama a `self.autobind20()` una vez que exista el HTML:

```js
COMPONENT('textbox', function(self) {
	self.make = function() {
		self.html('<input type="text" />');
		self.autobind20();
	};
});
```

Las funciones globales `FORMATTER()` y `PARSER()` se han eliminado. Regístralas en el componente:

```js
self.formatter(function(path, value) {
	return value ? value.toUpperCase() : value;
});
```

```js
self.parser(function(path, value) {
	return value ? value.toLowerCase() : value;
});
```

## Observadores y paths

Los argumentos de un observador han cambiado de orden, y el código sigue ejecutándose con los valores equivocados. [Paths](../paths/) describe los observadores en 20.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `WATCH('user.name', function(path, value, type) {` | `WATCH('user.name', function(value, flags, path) {` |
| `self.watch('user.name', function(path, value, type) {` | `self.watch('user.name', function(value, flags, path) {` |
| `exports.watch('count', function(value, path, type) {` | `exports.watch('count', function(value, flags, path) {` |
| `WATCH('user.*', function(path) {` | `WATCH('user', function(value, flags, path) {` |
| `WATCHONCE('user.name', function(path, value) {` | `UNWATCH('user.name', once);` dentro del callback |
| `ON('watch', 'user.name', function(path, value) {` | `WATCH('user.name', function(value) {` |

Un observador en un path padre también se ejecuta para los paths que hay debajo, así que `WATCH('user', ...)` sustituye al comodín.

## Escribir en el modelo

El tercer argumento de `SET()` se ha eliminado. Un retardo o un flag de reinicio pasado ahí se ignora, y el valor se escribe de inmediato.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `SET('user.name', 'Ann', 100);` | `setTimeout(() => SET('user.name', 'Ann'), 100);` |
| `SET('form.city', 'Vienna', true);` | `SET('form.city @reset', 'Vienna');` |
| `PUSH('cart.items', [2, 3]);` | `[2, 3].forEach(item => PUSH('cart.items', item));` |
| `PUSH('cart.items', 'tea');` en un path inexistente | `SET('cart.items', ['tea']);` |
| `NOTIFY('user.name');` | `UPD('user.name');` |
| `EXT('user', { age: 30 });` | `SET('user', Object.assign(GET('user'), { age: 30 }));` |
| `MAKE(function(obj) {` | Un objeto simple |
| `EVALUATE('user.age', 'value >= 18')` | `FN('value => value >= 18')(GET('user.age'))` |
| `REMOVECACHE('token');` | `CACHE('token', null, '1 day');` |
| `CL_INIT('colors', function(next) {` | `CLINIT('colors', function(next) {` |

`PUSH()` sobre un path que no existe no notifica a ningún observador, así que crea el array con `SET()`.

El tercer argumento de `CACHEPATH()` ahora es un valor predeterminado, y los valores guardados por jComponent 19 no se leen:

```js
CACHEPATH('filter.q', '1 day', 'all');
console.log(GET('filter.q')); // all
```

## Llamar a componentes y funciones

| jComponent 19 | jComponent 20 |
| --- | --- |
| `SETTER('box', 'show', 1);` | `SETTER('box/show', 1);` |
| `RECONFIGURE('box', 'size:2');` | `SETTER('box/reconfigure', 'size:2');` |
| `RETURN('box/name')` | `FIND('box').name` |
| `FIND('box', function(com) {` | `WAIT(() => FIND('box'), function() {` |
| `EXEC(true, 'FUNC.start', 'now');` | `EXEC('FUNC.start @important', 'now');` |
| `AEXEC('FUNC.save', 1)` | `() => EXEC('FUNC.save', 1)` |
| `ADD('box__user.name', '#panel');` | `$('#panel').append('<ui-component name="box" path="user.name"></ui-component>');` |

## Atributos de marcado

Las formas con atributos se ignoran sin dar error, y los elementos quedan vacíos. Usa los elementos personalizados descritos en [Uso de componentes](../using-components/) y [Enlace de datos](../data-binding/).

| jComponent 19 | jComponent 20 |
| --- | --- |
| `<div data---="box__user.name__size:2"></div>` | `<ui-component name="box" path="user.name" config="size:2"></ui-component>` |
| `<span id="name" data-bind="user.name__text"></span>` | `<ui-bind id="name" path="user.name" config="text"></ui-bind>` |
| `<div id="box" data-scope="panel">` | `<ui-plugin id="box" path="panel">` |

## Scopes y plugins

En 20 no hay objeto scope. Un elemento `<ui-plugin>` es el scope, y `$(selector).plugin()` devuelve la instancia. Un elemento con paths `?` fuera de un `<ui-plugin>` no se renderiza. [Plugins](../plugins/) describe el objeto plugin.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `var scope = $('#panel').scope();` | `var plugin = $('#panel').plugin();` |
| `console.log(scope.path); // invoice` | `console.log(plugin.path.toString()); // invoice` |
| `scope.watch('number', function(path, value) {` | `plugin.watch('number', function(value, flags, path) {` |
| `<ui-plugin path="address">` anidado en un plugin | `<ui-plugin path="?.address">` |
| `<ui-plugin path="!shared">` | `<ui-plugin path="shared">` |
| `<ui-plugin path="login" default="{ user: 'guest' }">` | `exports.set('user', 'guest');` en el plugin |
| `function loginready(path, element) {` | `function loginready(element) {` |
| `config="text:?/format"` | `config="text:PLUGINS.contact.format(value)"` |

Un `<ui-plugin>` anidado ya no amplía el path de su padre. Escribe `?` en el path para obtener el resultado anterior; si no, el plugin lee un path global con el mismo nombre:

```html
<ui-plugin path="order">
	<ui-plugin path="?.address">
		<ui-bind id="city" path="?.city" config="text"></ui-bind>
	</ui-plugin>
</ui-plugin>
```

**Un plugin necesita su elemento.** En 19, `PLUGIN()` creaba la instancia por sí solo. En 20, el callback solo se ejecuta cuando existe un elemento `<ui-plugin>` con ese path, así que un plugin sin elemento nunca arranca:

```html
<ui-plugin path="orders"></ui-plugin>
```

| jComponent 19 | jComponent 20 |
| --- | --- |
| `exports.extend('filter', { page: 2 });` | `exports.set('filter', Object.assign(exports.get('filter'), { page: 2 }));` |
| `PLUGINS.orders.reset();` | `RESET(PLUGINS.orders.path.toString());` |
| `exports.api('/api/ orders_list', { page: 1 }, function() {` | `API('/api/', 'orders_list', { page: 1 }, function() {` |
| `console.log(exports.modified); // {"city":"Prague"}` | El código de más abajo |

`exports.modified` devuelve el modelo completo y borra el estado de los componentes. Recoge antes los campos modificados:

```js
var changed = {};
COMPONENTS(exports.path + ' @modified').forEach(com => changed[com.path.toString().split('.').pop()] = com.get());
RESET(exports.path.toString());
console.log(changed); // {"city":"Prague"}
```

## Comandos de ui-bind

Se han eliminado varios comandos de `<ui-bind>`, y la mayoría se omiten sin dar error. La expresión de un comando es JavaScript normal, así que una llamada dentro de ella sustituye a casi todos. La [referencia de ui-bind](../../reference/ui-bind/) enumera los comandos de 20.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `config="text;format:2"` | `config="text:value.format(2)"` |
| `config="text;currency:eur"` | `config="text:value.currency('eur')"` |
| `config="text;default:'none'"` | `config="text:value == null ? 'none' : value"` |
| `config="text;helper:pluralize('no items','# item','# items','# items')"` | `config="text:value.pluralize('no items','# item','# items','# items')"` |
| `config="text;selector:b"` | `config="text" child="b"` |
| `config="checked input"` | `config="checked"` |
| `config="init:FUNC.start;text"` | `config="exec:FUNC.start;text"` |
| `config="click:FUNC.open"` | `<button id="a" class="exec" data-exec="FUNC.open">Open</button>` |
| `config="setter:'box/show',value"` | `config="exec:FUNC.show"` |
| `config="config:'size:' + value"` | `<ui-component name="box" config="=size:ui.size"></ui-component>` |

**El valor `false` se renderiza vacío** con el comando `text`. Convierte el valor en una cadena:

```html
<ui-bind id="a" path="order.count" config="text:value + ''"></ui-bind>
```

## Componentes

El `path` de un componente ahora es un objeto. Compararlo con una cadena da `false`, y no tiene métodos de cadena como `split()`, así que conviértelo primero. El tercer argumento de `self.setter` es un objeto con flags en lugar de un número. [Creación de componentes](../creating-components/) describe los delegates.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `self.path === 'form.name'` | `self.path.toString() === 'form.name'` |
| `self.setter = function(value, path, type) {` | `self.setter = function(value, path, flags) {` |
| `type === 0` | `flags.init` |
| `self.notify();` | `self.upd();` |
| `self.faicon('home')` | `self.icon('home')` |
| `self.scopepath('user.age')` | `self.makepath('user.age')` |
| `self.inc(2);` | `self.set(self.get() + 2);` |
| `self.extend({ b: 2 });` | `self.set(Object.assign(self.get(), { b: 2 }));` |
| `self.dirty()` | `!config.touched` |
| `self.dirty(false);` | `self.touch();` |
| `self.invalid();` | `self.reconfigure({ touched: 1, invalid: true });` |
| `self.skip();` antes de `self.set(2);` | `self.rewrite(2);` |
| `self.main()` | `self.element.parent().component()` |
| `self.exec('show', 1)` | `self.element.SETTER('*/show', 1)` |
| `self.data('page', 2);` | Una variable dentro del componente |

Los argumentos de `self.state(type, what)` tienen valores distintos en 20. Lee el estado desde `config`:

```js
self.state = function() {
	if (config.touched && config.modified && !changed) {
		changed = true;
		console.log('changed');
	}
};
```

`self.bindchanges()` se ha eliminado. Compara el valor en el setter:

```js
var last;
self.setter = function(value) {
	if (value !== last) {
		last = value;
		console.log(value);
	}
};
```

## Macros y enlaces virtuales

`MACRO()`, el comando `macro`, `VBIND()`, `VBINDARRAY()` y el comando `vbindarray` se han eliminado. Reescribe cada macro como un componente y cada enlace virtual como un comando `template` con [Tangular](../tangular/).

| jComponent 19 | jComponent 20 |
| --- | --- |
| `MACRO('clicks', function(self, element) {` | `COMPONENT('clicks', function(self) {` |
| `config="macro:clicks"` | `<ui-component id="c" name="clicks" path="counter"></ui-component>` |
| `VBIND('<div><b data-bind=".name__text"></b></div>')` | `config="template"` |
| `VBINDARRAY('<li data-bind=".name__text"></li>', '#list')` | `config="template"` |
| `config="vbindarray"` | `config="template"` |

```html
<ui-component id="c" name="clicks" path="counter"></ui-component>
```

```js
COMPONENT('clicks', function(self) {
	self.make = function() {
		self.event('click', () => self.set((self.get() || 0) + 1));
	};
	self.setter = function(value) {
		self.text('Clicked ' + (value || 0));
	};
});
```

Una lista que usaba `VBINDARRAY()` se convierte en una plantilla:

```html
<ul id="list">
	<ui-bind path="rows" config="template">
		<script type="text/html">{{ foreach m in value }}<li>{{ m.name }}</li>{{ end }}</script>
	</ui-bind>
</ul>
```

## El objeto M

`M` sigue existiendo y es el mismo objeto que `jComponent` y `MAIN`. `M.version`, `M.components` y `M.binders` funcionan como antes. Los métodos que modificaban el modelo se han eliminado o reciben otros argumentos, así que usa las funciones globales.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `M.set('user.name', 'Ann');` | `SET('user.name', 'Ann');` |
| `M.inc('user.age', 2);` | `INC('user.age', 2);` |
| `M.push('user.tags', 'new');` | `PUSH('user.tags', 'new');` |

## AJAX y API

El callback de `AJAX()` solo recibe la respuesta, y `AJAX()` ya no devuelve una Promise. La referencia de [Funciones globales](../../reference/globals/) describe `AJAX()`.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `AJAX('GET /orders/', function(response, err) {` | `ON('response', opt => status = opt.status);` |
| `AJAX('GET /orders/').then(function(response) {` | `new Promise(resolve => AJAX('GET /orders/', resolve)).then(function(response) {` |
| `AJAX('GET /orders/ error', () => console.log('callback'));` | `AJAX('GET /orders/ ERROR', () => console.log('callback'));` |
| `AJAX('GET /orders/ {"X-Token":"abc"}', function() {` | `ON('request', opt => opt.headers['X-Token'] = 'abc');` |
| `AJAXCONFIG('secure', function(options) {` | `ON('request', function(options) {` |
| `AJAXCACHE('GET /orders/', null, NOOP, '1 minute');` | `AJAX('GET /orders/ <1 minute>', NOOP);` |
| `AJAX('GET /orders/', null, 'orders', 100);` | `setTimeout(() => AJAX('GET /orders/', 'orders'), 100);` |
| `API('/api/ users_save', { name: 'Ann' }, function() {` | `API('/api/', 'users_save', { name: 'Ann' }, function() {` |
| `DAPI('users_save', { name: 'Ann' }, function() {` | `TAPI('users_save', { name: 'Ann' }, function() {` |

Para leer el código de estado de una respuesta, escucha el evento `response` antes de la petición:

```js
var status = 0;

ON('response', opt => status = opt.status);

AJAX('GET /orders/', function(response) {
	console.log(response.error, status); // denied 403
});
```

## Ajustes

| jComponent 19 | jComponent 20 |
| --- | --- |
| `DEF.validators.email` | `DEF.regexp.email` |
| `DEF.pathcommon` | `DEF.path.common` |
| `DEF.pathcl` | `DEF.path.cl` |
| `DEF.environment` | `DEF.env` |
| `DEF.languagehtml = 'sk';` | `DEF.language = 'sk';` |

Estos ajustes ya no existen: `ajaxcredentials`, `ajaxcredentialshtml`, `ajaxerrors`, `customelements`, `delay`, `delaybinder`, `delaykeypress`, `delaypref`, `delayrepeat`, `delaywatcher`, `fallbackcache`, `importcache`, `jsoncompress`, `jsonconverter`, `jsondate`, `keypress`, `makeurl`, `monitor`, `prefixcssmacros`, `repeatfocus`, `scope`, `secret` y `versioncomponents`. La referencia de [DEF](../../reference/def/) enumera los ajustes de 20.

## Eventos

| jComponent 19 | jComponent 20 |
| --- | --- |
| `ON('destroy', name => console.log('removed', name));` | `self.destroy = () => console.log('removed', self.name);` |
| `ON('watch', 'user.name', function(path, value) {` | `WATCH('user.name', function(value) {` |

El evento `exec` ya no se emite. `WW` y `WH` no se establecen hasta que arranca la biblioteca, así que léelos dentro de `ON('ready', ...)`. La referencia de [Eventos](../../reference/events/) enumera los eventos de 20.

## Helpers de jQuery

| jComponent 19 | jComponent 20 |
| --- | --- |
| `$('#panel').components()` | `$('#panel').COMPONENTS()` |
| `$('#panel').FIND('box')` | `$('#panel').COMPONENTS().findItem('name', 'box')` |
| `$('#panel').RECONFIGURE('box', 'size:2');` | `$('#panel').SETTER('box/reconfigure', 'size:2');` |
| `$('#panel').EMIT('hello', 1);` | `EMIT('hello', 1);` |

## Helpers de cadenas, números, fechas y arrays

| jComponent 19 | jComponent 20 |
| --- | --- |
| `'Hello {name}'.arg({ name: 'Ann' })` | `'Hello {name}'.args({ name: 'Ann' })` |
| `'{{ name }}'.render({ name: 'Ann' })` | `Tangular.render('{{ name }}', { name: 'Ann' })` |
| `'<b>Ann</b>'.removeTags()` | `'<b>Ann</b>'.replace(/<[^>]*>/g, '')` |
| `'a=1&b=2'.parseEncoded()` | `Object.fromEntries(new URLSearchParams('a=1&b=2'))` |
| `new Date(2026, 0, 5).toNumber()` | `+new Date(2026, 0, 5).format('yyyyMMdd')` |
| `new Date(2026, 0, 5).parseDate()` | `new Date(2026, 0, 5)` |
| `(5).between({ 1: 'low', 10: 'high' })` | `value < 10 ? 'low' : 'high'` |
| `tasks.async(() => console.log('done'));` | `tasks.wait((task, next) => task(next), () => console.log('done'));` |

`String.parseConfig()` ya no acepta un callback y, si le pasas uno, lo ignora sin dar error. Recorre el objeto devuelto:

```js
var config = 'size:2;open:true'.parseConfig();

for (var key in config)
	console.log(key, config[key]);
```

## Funciones sin sustituto

Estas funciones globales se han eliminado y 20.015 no tiene un equivalente directo.

| jComponent 19 | jComponent 20 |
| --- | --- |
| `WAPI`, `WAPI_INIT`, `AJAXCACHEREVIEW` | Sin sustituto |
| `DEBUG`, `STOPDEBUG` | Sin sustituto |
| `QUEUE`, `REPEAT`, `WORKFLOW` | Sin sustituto |
| `PLUGINABLE`, `VERSION`, `IMPORTCACHE` | Sin sustituto |
| `CLEARCACHE`, `REWRITE`, `REWRITE2`, `NOTMODIFIED`, `BIND`, `OPT` | Sin sustituto |

## Un formulario completo

Este formulario tiene dos campos obligatorios y un botón que se activa cuando el formulario es válido. Las dos versiones se comportan igual: el primer guardado indica los dos paths no válidos, y un guardado con los campos rellenos devuelve el modelo.

Antes, en jComponent 19:

```html
<ui-component name="textbox" path="form.name" config="label:Name;required:true"></ui-component>
<ui-component name="textbox" path="form.email" config="label:Email;required:true;email:true"></ui-component>
<button id="save" disabled>Save</button>
<script>
COMPONENT('textbox', function(self, config) {

	self.validate = function(value) {
		if (!config.required)
			return true;
		if (!value)
			return false;
		return config.email ? DEF.validators.email.test(value) : true;
	};

	self.make = function() {
		self.html('<label>' + config.label + '</label><input type="text" data-jc-bind />');
	};
});

var form = { name: '', email: '' };

WATCH('form.*', function(path, value, type) {
	$('#save').prop('disabled', DISABLED('form.*'));
});

function save() {

	CHANGE('form.*');

	if (!VALID('form.*')) {
		console.log(ERRORS('form.*').map(com => com.path));
		return;
	}

	console.log(GET('form @reset'));
}
</script>
```

Después, en jComponent 20:

```html
<ui-component name="textbox" path="form.name" config="label:Name;required:true"></ui-component>
<ui-component name="textbox" path="form.email" config="label:Email;required:true;email:true"></ui-component>
<button id="save" disabled>Save</button>
<script>
COMPONENT('textbox', function(self, config) {

	self.validate = function(value) {
		if (!config.required)
			return true;
		if (!value)
			return false;
		return config.email ? DEF.regexp.email.test(value) : true;
	};

	self.make = function() {
		self.html('<label>' + config.label + '</label><input type="text" />');
		self.autobind20();
	};
});

var form = { name: '', email: '' };

function can(path) {
	return COMPONENTS(path + ' @invalid').length === 0 && COMPONENTS(path + ' @touched').length > 0;
}

WATCH('form', function(value, flags, path) {
	$('#save').prop('disabled', !can('form'));
});

function save() {

	UPD('form @change');

	ERRORS('form', function(list) {

		if (list.length) {
			console.log(list.map(com => com.path.toString()));
			return;
		}

		console.log(GET('form @reset'));
	});
}
</script>
```
