Using AngularAMD / Requirejs loading issue

4 posts, 0 answers
  1. jason777
    jason777 avatar
    16 posts
    Member since:
    Jul 2006

    Posted 11 Mar 2015 Link to this post

    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?
  2. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 12 Mar 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. jason777
    jason777 avatar
    16 posts
    Member since:
    Jul 2006

    Posted 12 Mar 2015 in reply to Mihai Link to this post

    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.
  5. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 13 Mar 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready