---
title: M
project: jComponent V19
version: 19.194
section: reference
language: de
license: MIT
url: https://totaljs.es/docs/de/jcomponent-v19/19-194/reference/m/
updated: 2026-11-18T13:58:24.464Z
---

# M

> Die Member des Hauptobjekts der Bibliothek.

`M` ist ein Kurzname für [MAIN](../main/). Die meisten Anwendungen verwenden statt dieser Member die [globalen Funktionen](../globals/). Die Konzepte dahinter erklärt [Paths](../../guides/paths/).

## API

### M.binders

Type: `property`

Ein Array der aktiven Datenbindungen.

Example: Beispiel
```js
SET('name', 'Peter');
setTimeout(function() {
	console.log(M.binders.length); // 1
}, 300);
```

### M.cl

Type: `property`

Die deklarierten Codelisten nach Namen.

Example: Beispiel
```js
CL_INIT('roles', next => next([]));
console.log(Object.keys(M.cl)); // ["roles"]
```

### M.compile([container])

Type: `method`

Durchsucht die Seite nach neuen Komponenten und Bindungen.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `container` | `Element|jQuery` | no |  | Beschränkt die Suche auf dieses Element. |

Verwende in deinem Code [COMPILE()](../globals/#compile).

Example: Beispiel
```js
console.log(typeof(M.compile)); // function
```

### M.components

Type: `property`

Ein Array der erstellten Komponenten.

Example: Beispiel
```js
ON('ready', function() {
	console.log(M.components.length); // 2
});
```

### M.days

Type: `property`

Dasselbe Array wie [DAYS](../globals/#days).

Example: Beispiel
```js
console.log(M.days === DAYS); // true
```

### M.default(path, [delay], [component], [reset])

Type: `method`

Stellt die Standardwerte der Komponenten auf einem Path wieder her.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | yes |  | Der Path. |
| `delay` | `Number` | no |  | Eine Verzögerung in Millisekunden. |
| `component` | `Component` | no |  | Beschränkt die Änderung auf eine Komponente. |
| `reset` | `Boolean` | no | `true` | Mit `false` bleibt der Zustand erhalten. |

Verwende in deinem Code [DEFAULT()](../globals/#default).

Example: Beispiel
```js
console.log(typeof(M.default)); // function
```

### M.defaults

Type: `property`

Dasselbe Objekt wie [DEF](../def/).

Example: Beispiel
```js
console.log(M.defaults === DEF); // true
```

### M.each(fn, [path])

Type: `method`

Ruft für jede Komponente eine Funktion auf.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `fn` | `Function` | yes |  | `function(component, index, wildcard)`. |
| `path` | `String` | no |  | Beschränkt den Aufruf auf einen Path. |

Gib in der Funktion `true` zurück, um abzubrechen.

Example: Beispiel
```js
ON('ready', function() {
	var paths = [];
	M.each(com => paths.push(com.path), 'form.*');
	console.log(paths.length); // 2
});
```

### M.events

Type: `property`

Die registrierten Event-Handler nach Event-Namen.

Example: Beispiel
```js
ON('hello', NOOP);
console.log(M.events.hello.length); // 1
```

### M.extend(path, value, [type])

Type: `method`

Führt Felder mit einem Objekt zusammen.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | yes |  | Der Path. |
| `value` | `Object` | yes |  | Die Felder. |
| `type` | `Number` | no |  | Der Änderungstyp: `1` manuell, `2` Eingabe, `3` Standardwert. |

Verwende [EXT()](../globals/#ext) für eine verzögerte Änderung.

Example: Beispiel
```js
SET('user', { a: 1 });
M.extend('user', { b: 2 });
console.log(GET('user')); // {"a":1,"b":2}
```

### M.inc(path, value, [type])

Type: `method`

Addiert eine Zahl zu einem Wert.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | yes |  | Der Path. |
| `value` | `Number` | yes |  | Die Zahl. |
| `type` | `Number` | no |  | Der Änderungstyp: `1` manuell, `2` Eingabe, `3` Standardwert. |

Verwende [INC()](../globals/#inc) für eine verzögerte Änderung.

Example: Beispiel
```js
M.inc('count', 2);
console.log(GET('count')); // 2
```

### M.loaded

Type: `property`

`true`, nachdem die gespeicherten Einstellungen geladen wurden.

Example: Beispiel
```js
setTimeout(function() {
	console.log(M.loaded); // true
}, 500);
```

### M.macros

Type: `property`

Die deklarierten Macros nach Namen.

Example: Beispiel
```js
MACRO('upper', NOOP);
console.log(typeof(M.macros.upper)); // function
```

### M.months

Type: `property`

Dasselbe Array wie [MONTHS](../globals/#months).

Example: Beispiel
```js
console.log(M.months === MONTHS); // true
```

### M.parse(type, value, [format])

Type: `method`

Wandelt einen Wert mit den registrierten Parsern um.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `type` | `String` | yes |  | Der Typ, zum Beispiel `number`. |
| `value` | `Object` | yes |  | Der Wert. |
| `format` | `String` | no |  | Das Format, das an die Parser übergeben wird. |

Returns: `Object` Der umgewandelte Wert.

Example: Beispiel
```js
console.log(M.parse('number', '5')); // 5
```

### M.paths

Type: `property`

Die Anzahl der Watcher und Komponenten für jeden Path.

Example: Beispiel
```js
WATCH('user.name', NOOP);
console.log(M.paths['user.name']); // 1
```

### M.performance

Type: `property`

Nutzungszähler, die gesammelt werden, wenn `DEF.monitor` den Wert `true` hat.

Example: Beispiel
```js
DEF.monitor = true;
GET('a');
console.log(M.performance.get.count > 0); // true
```

### M.plugin([name])

Type: `method`

Liest oder ändert den aktuellen Plugin-Scope.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `name` | `String` | no |  | Der neue Scope. |

Returns: `String` Der aktuelle Scope.

Example: Beispiel
```js
M.plugin('users');
console.log(M.plugin()); // users
```

### M.prototypes(fn)

Type: `method`

Gibt Zugriff auf die Prototypen der Objekte der Bibliothek.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `fn` | `Function` | yes |  | `function(proto)`. |

Das Objekt hat die Felder `Component`, `Plugin` und `VBinder`.

Example: Beispiel
```js
M.prototypes(function(proto) {
	proto.Component.hello = () => 'Hello';
});
ON('ready', function() {
	console.log(FIND('textbox').hello()); // Hello
});
```

### M.push(path, value, [type])

Type: `method`

Fügt einem Array einen Wert hinzu.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | yes |  | Der Path. |
| `value` | `Object` | yes |  | Das Element. |
| `type` | `Number` | no |  | Der Änderungstyp: `1` manuell, `2` Eingabe, `3` Standardwert. |

Verwende [PUSH()](../globals/#push) für eine verzögerte Änderung.

Example: Beispiel
```js
M.push('list', 1);
console.log(GET('list')); // [1]
```

### M.scope([name])

Type: `method`

Dieselbe Funktion wie [M.plugin()](#plugin).

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `name` | `String` | no |  | Der neue Scope. |

Returns: `String` Der aktuelle Scope.

Example: Beispiel
```js
console.log(M.scope === M.plugin); // true
```

### M.scrollbars

Type: `property`

Ein Array der benutzerdefinierten Scrollbars.

Example: Beispiel
```js
console.log(M.scrollbars.length); // 0
```

### M.set(path, value, [type])

Type: `method`

Schreibt einen Wert in einen Path.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | yes |  | Der Path. |
| `value` | `Object` | yes |  | Der Wert. |
| `type` | `Number` | no |  | Der Änderungstyp: `1` manuell, `2` Eingabe, `3` Standardwert. |

Verwende [SET()](../globals/#set) für eine verzögerte Änderung.

Example: Beispiel
```js
M.set('name', 'Peter');
console.log(GET('name')); // Peter
```

### M.ua

Type: `property`

Der geparste User-Agent mit den Feldern `os`, `browser` und `device`.

Example: Beispiel
```js
console.log(Object.keys(M.ua)); // ["os","browser","device"]
```

### M.update(path, [reset], [type])

Type: `method`

Aktualisiert alles, was an einen Path gebunden ist.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | `String` | yes |  | Der Path. |
| `reset` | `Boolean` | no |  | Setzt den Zustand der Komponenten zurück. |
| `type` | `Number` | no |  | Der Änderungstyp: `1` manuell, `2` Eingabe, `3` Standardwert. |

Verwende [UPD()](../globals/#upd) für eine verzögerte Änderung.

Example: Beispiel
```js
SET('user', { name: 'Peter' });
WATCH('user.name', function(path, value) {
	console.log(value); // Anna
});
GET('user').name = 'Anna';
M.update('user.name');
```

### M.version

Type: `property`

Die Version der Bibliothek.

Example: Beispiel
```js
console.log(M.version); // 19.194
```
