title: LeafletJs - Cannot set property 'L' of undefined
body: <p>I'm using LeafletJs in my AngularJS (Version 1.5.8) project as a map, recently I have been using the unpkg.com URL - until recently I have however decided to use the locally downloaded code instead (there are several reasons why - one of them being the app working offline).</p>
  
  <p>The problem I'm having now is whenever I even just load the script in the <code>index.html</code> file, I would get this error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot set property 'L' of undefined</p>
  </blockquote>
  
  <p>Looking into the source code, the part of the code throwing the error is at the very start of the Javascript:</p>
  
  <pre><code>(function (global, factory) {
      typeof exports === 'object' &amp;&amp; typeof module !== 'undefined' ? factory(exports) :
      typeof define === 'function' &amp;&amp; define.amd ? define(['exports'], factory) :
      (factory((global.L = {}))); // This line is where the error is thrown.
  }(this, (function (exports) { 'use strict';
  // Here would now be the entire code of Leaflet.
  </code></pre>
  
  <p>While doing a bit more testing, <code>global</code> is coming in as <code>undefined</code>.</p>
  
  <p>I haven't called Leaflet at all yet. Even commenting out all but this script will result in me still getting this error. I think it has something to do with Agular more than anything, but I'd like to know if I'm doing something wrong.</p>
  
  <p>Any help at all would be greatly appreciated.</p>