title: Javascript library not working on Device
body: <p>I am using the <a href="http://mikemcl.github.io/bignumber.js/" rel="nofollow noreferrer">BigNumber library of MikeMcl</a> to handle my needs for big numbers. I use this library in an <a href="http://ionicframework.com/" rel="nofollow noreferrer">Ionic/Angular project</a>.</p>
  
  <p>As explained on <a href="https://github.com/MikeMcl/bignumber.js/" rel="nofollow noreferrer">Github</a>, the way to install and use this library is to include a script tage in your html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;!-- compiled css output --&gt;
      &lt;link href="css/ionic.app.min.css" rel="stylesheet"&gt;
      &lt;link href="css/style.css" rel="stylesheet"&gt;
  
      &lt;!-- ionic/angularjs js --&gt;
      &lt;script src="lib/ionic/js/ionic.bundle.min.js"&gt;&lt;/script&gt;
  
      &lt;!-- cordova script (this will be a 404 during development) --&gt;
      &lt;script src="lib/ngCordova/dist/ng-cordova.min.js"&gt;&lt;/script&gt;
      &lt;script src="cordova.js"&gt;&lt;/script&gt;
  
      &lt;!-- ********* BIGNUMBER library ********* --&gt;
      &lt;script src='lib/bignumber.js/bignumber.min.js'&gt;&lt;/script&gt;    
  
      &lt;script src="js/app.js"&gt;&lt;/script&gt;
      &lt;script src="js/controllers.js"&gt;&lt;/script&gt;
      &lt;script src="js/services.js"&gt;&lt;/script&gt;
  
    &lt;/head&gt;
    &lt;body ng-app="starter"&gt;
      &lt;ion-nav-view&gt;&lt;/ion-nav-view&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now in my code, I can use this library as for instance:</p>
  
  <pre><code>x = new BigNumber(123.4567)
  y = BigNumber('123456.7e-3')
  z = new BigNumber(x)
  x.equals(y) &amp;&amp; y.equals(z) &amp;&amp; x.equals(z)      // true
  </code></pre>
  
  <p>I tested this and it works fine on Chrome and on Safari (even on device).</p>
  
  <p>But when I install the app on my phone, <strong>using Phonegap Build</strong>, the app does not work anymore (I checked that this library is the cause by removing the BigNumber syntaxes from my code). Moreover, the Angular in the app just crashes and shows for instance <code>{{variableName}}</code> and nothing is working.</p>
  
  <p>Because I develop in a cloud environment, I did try to debug the app using the Safari Developer Debug Console on a mac (by plugging my phone with an USB to the mac and then enabling Developer tools in Safari).</p>
  
  <p>However, no errors were found with exception of one: </p>
  
  <pre><code>file not found: "path/to/ionic/lib/js/angular.min.js.map" 404
  </code></pre>
  
  <p>But <a href="https://stackoverflow.com/questions/21719562/javascript-map-files-javascript-source-maps">this is not the cause of the problem</a>.</p>
  
  <p>What is going on? How can I still use this javascript library on my device?</p>