AnsweredAssumed Answered

add angular js as resource in dashboard

Question asked by Raj Karan on Jan 16, 2018
Latest reply on Jan 25, 2018 by Andre Jorge

I want to add AngularJS in my dashboard. I am aware that AngularJS is not AMD module so I will have to add it to shim, which I am trying to do.

var requireConfig = requireCfg.config;


if(!requireConfig['amd']) {
requireConfig['amd'] = {};
}


if(!requireConfig['amd']['shim']) {
requireConfig['amd']['shim'] = {};
}


requireConfig['amd']['shim']["cde/resources/public/AngularJS in Dashboard/angular.min"] = {
exports: "angular"
};


requirejs.config(requireCfg);


define([
    "cdf/lib/jquery", 
    "amd!cdf/lib/jquery.chosen",
    "amd!cde/resources/public/AngularJS in Dashboard/angular.min"
], 
function($, jQuery, angular) {
   console.log(jQuery, angular) 
});

 

Dashboard is sitting in public/AngularJS in Dashboard/ directory.

When I runs this I gets timeout error.

Uncaught Error: Load timeout for modules: amd!cde/resources/public/AngularJS in Dashboard/angular.min,cde/resources/public/AngularJS in Dashboard/angular.min
http://requirejs.org/docs/errors.html#timeout
    at C (require.js:8)
    at D (require.js:13)
    at require.js:14

 

What am I missing?

Outcomes