11-04-2016 01:59 AM
Hi,
can i use javascript file with aikau page as like dashlet javascript file in aikau dashelt?
Regards
janaka
11-04-2016 03:18 AM
11-04-2016 07:21 AM
HI Mittal,
i read this blog from dave. i can use one common js file with aikau widget. but i have doubt whether we can use common JS to put logic.
Also extended custom widget (it contain following content ) does use to manage custom widget and logic that is specific to widget
e.g
define(["dojo/_base/declare",
"dijit/_WidgetBase",
"alfresco/core/Core",
"dijit/_TemplatedMixin",
"dojo/text!./HelloWorldTextWidget.html"
],
function(declare, _Widget, Core, _Templated, template) {
return declare([_Widget, Core, _Templated], {
11-04-2016 07:42 AM
Each widget defines the specific JS modules that it is dependent upon. So in that example the widget is dependent upon:
Each of those JS files can declare their own dependencies. Surf will calculate the dependency tree for all widgets on the page and ensure that they are included in a single resource requested by the page when it is loaded.
There is nothing to stop any of the resources being shared between widgets - however, in the AMD pattern (and indeed any module based architecture) the widget needs to declare its dependencies in order to have access to them
However, this does not stop the widget from having access to any JavaScript code that is available at the global scope. However, it is more efficient to use a modular pattern because you only load the resources required for the page and therefore improve page performance.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.