title: Angular leaflet marker click
body: <p>I use leaflet with angular and would like to make a button clickable in a message popup.  I know I have to compile the HTML, but I can't get it to work in my case since I didn't find an example with a json-request.</p>
  
  <p>Any hint is very welcome!</p>
  
  <pre><code>$http.get(searchterm).then(function(articlesResponse) {
  
          $scope.geonamesorte = articlesResponse.data;
  
          var meineMarker = {};
  
          for ( var i = 0; i &lt; $scope.geonamesorte.length; i++) {
              var ortObjektausListe = $scope.geonamesorte[i];
  
              var myobjectname = ortObjektausListe.name.replace(/[^a-zA-Z0-9]/g,'_');
              ortlat = parseFloat(ortObjektausListe.lat);
              ortlng = parseFloat(ortObjektausListe.lng);
  
              meineMarker[myobjectname+i] =  {
                      lat: ortlat,
                      lng: ortlng,
                      message: "&lt;span&gt;&lt;a href='' ng-click='dosomething()''&gt;info&lt;/a&gt;&lt;/span&gt;",
                      focus: false,
                      draggable: false
                  };
  
          }
  
          // Marker on map
          angular.extend($scope, {
            markers: meineMarker,
              defaults:{
                tileLayer:"http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png"
              }
          });
  
    });
  </code></pre>