Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try <a href="http://jsfiddle.net/fiddlegrimbo/7cRE4/4/" rel="nofollow">splitting the config out from the application JS</a>:</p> <h3>steps</h3> <ul> <li>create requirejs config</li> <li>import requirejs</li> <li>use the modules</li> </ul> <h3>html</h3> <pre><code>&lt;script&gt; var require = { paths: { 'jquery': '//code.jquery.com/jquery-1.9.1', 'angular': '//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min', 'bootstrap': '//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min', 'my-library': '//gist.github.com/gitgrimbo/5689953/raw/9b44d7e5f504b2245331be3ed3fcbb7bf8635da6/gistfile1' }, shim: { 'bootstrap' : {deps:['jquery']}, 'angular' : {exports:'angular'} } }; &lt;/script&gt; &lt;script data-main="https://gist.github.com/gitgrimbo/5690017/raw/aea9f61c47e9250b89c3d8fdb7511582f81664a4/gistfile1.js" src="http://requirejs.org/docs/release/2.1.5/comments/require.js"&gt; &lt;/script&gt; </code></pre> <h3>gistfile1.js (aka main.js)</h3> <pre><code>define(["angular", "my-library", "bootstrap"], function (angular, myLibrary, bootstrap) { console.log(angular.version); console.log(myLibrary); console.log(undefined === bootstrap, "bootstrap augments jQuery and has no module return value"); console.log("1.9.1" === $.fn.jquery, "boostrap should have caused jQuery to load"); console.log("function" === typeof $.fn.alert.Constructor, "boostrap adds alert"); }); </code></pre> <h3>console output</h3> <pre><code>Object { full="1.0.6", major=1, minor=0, more...} my-library true bootstrap augments jQuery and has no module return value true boostrap should have caused jQuery to load true boostrap adds alert </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload