Fix plugin server demo
Change-Id: Ie36ea140e83b910a9a4eb2ca2024cfed4504645a
diff --git a/dev/demo/plugin-serverdemo.js b/dev/demo/plugin-serverdemo.js
index d606cff..9b05ce0 100644
--- a/dev/demo/plugin-serverdemo.js
+++ b/dev/demo/plugin-serverdemo.js
@@ -44,4 +44,14 @@
}];
-require(['app/en','init']);
+define(['plugin/server', 'lib/domReady', 'app/en', 'init'], function(pluginClass, domReady) {
+ domReady(function (event) {
+ if (KorAP.Plugin === undefined) {
+ // Load Plugin Server first
+ KorAP.Plugin = pluginClass.create();
+ // Add services container to head
+ document.head.appendChild(KorAP.Plugin.element());
+ };
+ KorAP.Plugins.forEach(i => KorAP.Plugin.register(i));
+ });
+});