Movatterモバイル変換


[0]ホーム

URL:


Dev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog InContent Management System
Dev Guide
All
Pages
Start typing to search…

Add a module initializer

Describes the module initializer in Optimizely.

A module initializer is a JavaScript function that runs when the related module is started. This is useful for doing any configuration or script loading that should be done before the edit user interface is made available.

Configure the initializer in themodule.config file for your app (add-on). Theinitializer attribute on
theclientModule element determines the path to the module initializer to run. For example:

<clientModule initializer="acme/Initializer"></clientModule>

The module initializer should return an object that has an initialize function. This function is called when the module initializer is run. You should extend epi/_Module when implementing a module initializer as this implements the expected API and provides helper methods for performing common initializer actions. So, the skeleton for your module initializer will look something like this:

define([    'dojo/_base/declare',    'epi/_Module'  ],  function (declare, _Module) {    return declare([_Module], {      initialize: function () {        this.inherited(arguments);      }    });  });

Updated 10 days ago



[8]ページ先頭

©2009-2025 Movatter.jp