This is a migrated thread and some comments may be shown as answers.

Using AngularAMD / Requirejs loading issue

3 Answers 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 2
Kevin asked on 11 Mar 2015, 02:48 PM
I'm using AngularAMD, and only want to load the Kendo controls I need only on certain modules that use them.

In my requirejs.config, I have all the paths and shims configured properly for the kendo stuff.  In my angular modules, I ngload the correct kendo module(s) I need for that module, and it will download the js/css files at that point.

The problem is, the require stuff in the kendo modules is not playing nice.  It does its own requirejs stuff.  
For example, kendo.progressbar.js has define(["./kendo.core"])

I already have kendo.core loaded via my angularAMD require config, but progress bar tries to load it itself.  The path it is trying to use is wrong because the kendo stuff isnt found in the base path I have set.   I do not want kendo to try and load anything via require.

If I remove "./kendo.core" from the kendo progressbar define section, everything works.  I dont want to have to modify each kendo file to get this to work.  Is there a better way?

3 Answers, 1 is accepted

Sort by
0
Mihai
Telerik team
answered on 12 Mar 2015, 10:31 AM
Hi,

Note that we're officially supporting RequireJS, but not AngularAMD.  That said, it should work.  There should be no need for you to manually load kendo.core, since it's declared as a dependency in other Kendo files.

Here is a sample that works (RequireJS + Angular, but no AngularAMD): http://dojo.telerik.com/@mishoo/uHEBA

If you still can't get it to work please show us some code and we will try to provide a solution.

Regards,
Mihai
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Kevin
Top achievements
Rank 2
answered on 12 Mar 2015, 02:57 PM
Yeah, I can get it to work as well if I put the kendo scripts in the same folder as the others (/scripts).  But if I have them in a  /scripts/kendo folder it cannot find them.  I would prefer that the kendo scripts do not try and load anything via require, OR make a way to tell it a path to pull from.
0
Mihai
Telerik team
answered on 13 Mar 2015, 09:54 AM
Hi,

As you can see in my sample, the scripts are stored not just in different folders, but actually on different domains -- so I can't see any problem storing scripts in different folders, except for some misconfiguration.

I'm sorry but in the absence of a reproducible scenario I'm afraid I can't help.

Regards,
Mihai
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Kevin
Top achievements
Rank 2
Answers by
Mihai
Telerik team
Kevin
Top achievements
Rank 2
Share this question
or