Hello!
I have tried running the example which is mentioned here: https://docs.camunda.org/manual/7.3/guides/user-guide/#tasklist-customizing-custom-scripts
I’ve modified the ui/tasklist/client/scripts/config/config.js file to include the custom angular module:
...
customScripts: {
// names of angular modules defined in your custom script files.
// will be added to the 'cam.tasklist.custom' as dependencies
ngDeps: ['my.custom.module'],
// RequireJS modules to load.
deps: ['custom-ng-module'],
// RequreJS path definitions
paths: {
'custom-ng-module': 'custom-ng-module/script'
}
},
...
Then I’ve created the custom-ng-module folder under ui/tasklist/client/scripts and placed the script.js file there:
/* eslint-disable no-undef */
(function() {
'use strict';
define('custom-ng-module', [
'angular'
], function(angular) {
// define a new angular module named my.custom.module
// it will be added as angular module dependency to builtin 'cam.tasklist.custom' module
// see the config.js entry above
var customModule = angular.module('my.custom.module', []);
// ...so now, you can safely add your controllers...
customModule.controller('customController', ['$scope', function($scope) {
$scope.var1 = 'First variable';
$scope.var2 = 'Second variable';
}]);
// ...directives or else.
customModule.directive('customDirective', function() {
return {
template: 'Directive example: "{{ var1 }}", "{{ var2 }}"'
};
});
// it is not necessary to 'return' the customModule but it might come handy
return customModule;
});
}());
* I had to adjust the file due to ESLINT warnings (but that doesn’t matter, since the original file in the instructions also gives the same error.
Then I ran mvn clean install -> mvn jetty:run -Pdevelope and grunt.
When I try to access the tasklist I get this error:
GET http://localhost:8080/camunda/app/tasklist/custom-ng-module/script.js?bust=7.7.0-SNAPSHOT-1494173452294 404 (Not Found)
req.load @ require.js:1
load @ require.js:1
load @ require.js:1
fetch @ require.js:1
check @ require.js:1
enable @ require.js:1
enable @ require.js:1
(anonymous) @ require.js:1
(anonymous) @ require.js:1
each @ require.js:1
enable @ require.js:1
init @ require.js:1
(anonymous) @ require.js:1
19:12:17.162 require.js:1 Uncaught Error: Script error for "custom-ng-module"
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:1)
at HTMLScriptElement.onScriptError (require.js:1)
makeError @ require.js:1
onScriptError @ require.js:1
and …
Uncaught Error: Script error for "custom-ng-module"
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:1)
at HTMLScriptElement.onScriptError (require.js:1)
makeError @ require.js:1
onScriptError @ require.js:1
I’ve searched for the script.js file and it isn’t there… Any ideas what I am doing wrong?
Thanks in advance!!