I am facing an issue with AngularJS integration in Confluence. I attempted to incorporate angular files as web resources in the atlassian-plugin.xml file:
<web-resource name="Angular js files" key="angular-sources">
<resource type="download" name="angular.js" location="js/angular/angular.js"/>
<resource type="download" name="angular-animate.js" location="js/angular/angular-animate.js"/>
<context>atl.general</context>
</web-resource>
While everything functions correctly when using either atlas-run or atlas-debug, the problem arises when I generate a new JAR file using atlas-package and install it on a fresh Confluence instance. My macro editor JavaScript files don't recognize the variables defined in angular.js.
I also tried directly adding angular files into the web resource for my new macro, but unfortunately, that approach didn't yield any positive results:
<web-resource name="Resources - handle macros with JS" key="macroeditor-resources">
<resource type="download" name="angular.js" location="js/angular/angular.js"/>
<resource type="download" name="angular-animate.js" location="js/angular/angular-animate.js"/>
…
<resource type="download" name="page-move-dialog.js" location="js/page-move-dialog.js"/>
<resource type="download" name="macro-editor-module.js" location="js/macro-editor-module.js"/>
…
</web-resource>
It seems like Confluence is ignoring the contents of the angular.js file. What could be causing this behavior? Below is a snippet of the JavaScript file generated by Confluence where angular.js content is missing:
try {
/* module-key = 'plugin.key:angular-sources', location = 'js/angular/angular.js' */
// HERE SHOULD BE INCLUDED angular.js
} catch (err) {
if (console && console.log && console.error) {
console.log("Error running batched script.");
console.error(err);
}
}
try {
/* module-key = 'plugin.key:angular-sources', location = 'js/angular/angular-animate.js' */
(function(b,a,c){a.module("ngAnimate",["ng"]).config(["$provide","$animateProvider",function(g,i){var l=a.noop;var f=a.forEach;var j=i.$$selectors;var e=1;...
})(window,window.angular);
} catch (err) {
if (console && console.log && console.error) {
console.log("Error running batched script.");
console.error(err);
}
}
Is there another method to include angular files in Confluence?