[Dojo-interest] Loading modules if required

Rakovsky Adrian adrian.rakovsky at gratex.com
Fri Jan 17 09:30:45 EST 2014


You can use dojo/has as AMD plugin

require(["dojo/has!myConfig?X:Y"],...)


And you can setup your custom has variables e.g. in dojo-config
data-dojo-config="has:{myConfig:true}..."


On 16.01.2014 13:46, chiranjeevibmse wrote:
> Hi
>
> i have a situation where based on the configuration need to 
> instantiate the variable for example
>
> var instance = null;
>
> if( config === 1)
> {
> instance = new X();
> }
>
> if( config === 2)
> {
> instance = new Y();
> }
>
> for this above code the require("X","Y");
>
> so the dojo will load both X.js and Y.js
>
> is their any other way to load any one js while based on the 
> configuration.
>
>
> ------------------------------------------------------------------------
> View this message in context: Loading modules if required 
> <http://dojo-toolkit.33424.n3.nabble.com/Loading-modules-if-required-tp4000730.html>
> Sent from the Dojo Toolkit mailing list archive 
> <http://dojo-toolkit.33424.n3.nabble.com/> at Nabble.com.
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> Dojo-interest at mail.dojotoolkit.org
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20140117/5f69326b/attachment.htm 


More information about the Dojo-interest mailing list