title: Using Skobbler in AngularJS directive: 'Map container is already initialized.'
body: <p>Using a directive to render the Skobbler leaflet:</p>
  
  <pre><code>angular.module('app.directives').directive('skm', function()
  {
      return {
          restrict: 'E',
          replace: true,
          scope: false,
          template: '&lt;div&gt;&lt;/div&gt;',
          link: function(scope, element, attrs) {
  
              var map = L.skobbler.map('skm', scope.skm);
  
              // ....
          }
      }
  });
  </code></pre>
  
  <p>This directive is used on different routes/partials in a similar way:</p>
  
  <pre><code>&lt;skm id="skm"&gt;&lt;/skm&gt;
  </code></pre>
  
  <p>Version info:</p>
  
  <ul>
  <li>Skobbler 2.0</li>
  <li>AngularJS 1.2.16</li>
  </ul>
  
  <p>When moving from page 1 to page 2, no problem. However, going back to page 1:</p>
  
  <pre><code>    Error: Map container is already initialized.
  </code></pre>
  
  <p>I've tried storing the map object and using <em>map.remove()</em>, which removes the error but stops the map from rendering.</p>
  
  <p><strong>FIXED</strong>: See my answer below. (Use unique ID's in each partial and grab those)</p>