4

I'm trying to let AngularJS use DevExtreme. I'm using TypeScript. Now there's a little problem, without using the DX module in my app it's all just working.. but when trying to use DX I'm getting this error:

angular.js:4087Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.0/$injector/modulerr?p0=myApp&p1=Error%3A%2…loudflare.com%2Fajax%2Flibs%2Fangular.js%2F1.3.0%2Fangular.min.js%3A18%3A3)

I have already been doing some research, but I just can't find any solution to this problem.

My code for injecting the modules:

var modules = ['controllers', 'services'];
modules.forEach((module) => angular.module(module, []));
modules.push("ngRoute");
modules.push("dx");

So, for clearance, this way it IS working:

var modules = ['controllers', 'services'];
modules.forEach((module) => angular.module(module, []));
modules.push("ngRoute");

Thanks in advance!

peer
  • 1,001
  • 4
  • 13
  • 29

1 Answers1

3

I have found the solution to my problem, some way AngularJS was not recognizing dx. So I went into the errors and searched and searched, and I found I had to use ngSanitze. So I just included the angular-sanitize.js file, this fixed my problem.

I also edited my forEach loop to this (gave some little red lines under the lambda experssion):

var modules = ['controllers', 'services'];
modules.forEach(
    (modules) => {
        angular.module(modules, []);
    });
modules.push("ngRoute");
modules.push("dx");

I hope this can help some of you as well.

peer
  • 1,001
  • 4
  • 13
  • 29