register

[ Funktion ]

function register(
    controlTypeName: string,
    constructor: TcHmi.Controls.baseTcHmiControlConstructor,
    directory: string,
    templatePath?: string | null
): void;

Registriert eine Controlklasse im System.

Vor der Nutzung eines Controls muss dieses dem System mit dieser Funktion bekannt gemacht werden.

register 1:

Ab Version 1.12 bitte die Funktion registerEx verwenden.

Parameter

Name

Typ

Beschreibung

controlTypeName

string

Name der Klasse.

constructor

Contructor

Konstruktor des Controls.

directory

string

Name des Ordner des Controls.

templatePath

string, null

Optional: Pfad einer Template HTML Datei welches in das Control geladen werden.

Rückgabewert

Typ

Beschreibung

void

Kein Rückgabewert.

register 2:

Verfügbar ab Version 1.8

Beispiel - JavaScript 1

TcHmi.Controls.register('tchmi-mycontrol', Custom.mycontrol, 'Custom/mycontrol/');

Beispiel - JavaScript 2


TcHmi.Controls.register('tchmi-mycontrol', Custom.mycontrol, 'Custom/mycontrol/', 'Custom/mycontrol/Template.html');