diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/html/html-container-settings.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/html/html-container-settings.component.html index a72f28e70e..4f891f1617 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/html/html-container-settings.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/html/html-container-settings.component.html @@ -122,7 +122,8 @@ [editorCompleter]="containerFunctionEditorCompleter" [functionArgs]="htmlContainerSettingsForm.get('type').value === HtmlContainerWidgetType.ANGULAR ? ['ctx'] : ['ctx', 'container']" withModules - functionTitle="{{ 'widgets.html-container.js-function' | translate }}"> + functionTitle="{{ 'widgets.html-container.js-function' | translate }}" + [helpId]="htmlContainerSettingsForm.get('type').value === HtmlContainerWidgetType.ANGULAR ? 'widget/lib/html_container/container_angular_fn' : 'widget/lib/html_container/container_plain_fn'"> diff --git a/ui-ngx/src/assets/help/en_US/widget/lib/html_container/container_angular_fn.md b/ui-ngx/src/assets/help/en_US/widget/lib/html_container/container_angular_fn.md new file mode 100644 index 0000000000..2f739b9770 --- /dev/null +++ b/ui-ngx/src/assets/help/en_US/widget/lib/html_container/container_angular_fn.md @@ -0,0 +1,135 @@ +#### Container function + +
+this. Reference them in the template without the this prefix.
+
+**Parameters:**
+
+WidgetContext - A reference to WidgetContext that has all necessary API
+ and data used by widget instance.this.
+
+
+
+##### Notes
+
+container parameter in Angular mode. Access the root element via ctx.$container[0] or event.currentTarget.closest(...) from a handler.this.ctx.detectChanges() after changing template-bound values so the template re-renders.ctx.data populated from the widget configuration. To read live data create an explicit subscription via ctx.subscriptionApi.createSubscription(...) and release it from ctx.registerDestroyCallback(...).WidgetContext - A reference to WidgetContext that has all necessary API
+ and data used by widget instance.HTMLElement - The widget's content element, a native DOM node (<div class="tb-absolute-fill">) wrapping the rendered template.container.querySelector(...).
+ ctx.data populated from the widget configuration. To read live data create an explicit subscription via ctx.subscriptionApi.createSubscription(...).ctx.registerDestroyCallback(...) so the widget cleans up correctly.echarts global (accessed as window.echarts):
+
+```text
+{:code-style="max-height: 400px;"}
+https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js
+{:copy-code}
+```
+
+Sortable global (accessed as window.Sortable):
+
+```text
+{:code-style="max-height: 400px;"}
+https://cdn.jsdelivr.net/npm/sortablejs@1/Sortable.min.js
+{:copy-code}
+```
+
+