title: AngularJS: 'google-maps': call directive in infoWindow
body: <p>I'm using <a href="http://nlaplante.github.io/angular-google-maps/" rel="nofollow">http://nlaplante.github.io/angular-google-maps/</a> to display a map in my angular Application.
  I have a general controller for my page getting a Json.
  to display markers, i'm using $watch in the scope cause I will do real time and the markers positions can change.</p>
  
  <pre><code>$scope.model  = new Model 'api/now.json'
  $scope.state  = new DState
  
  $scope.$watch -&gt;
    markers = []
    _($scope.model.objects).each (obj) -&gt;
      markers.push
        latitude:   obj.latitude
        longitude:  obj.longitude
        infoWindow: "&lt;info-window&gt;SHOULD NOT DISPLAY CAUSE DIRECTIVE&lt;/info-window&gt;"
  
    markers
    , (newValue) -&gt;
      $scope.state.map.markers = newValue
    , true
  </code></pre>
  
  <p>My directive is basic:</p>
  
  <pre><code>am.directive "infoWindow", -&gt;
  
  restrict: 'E'
  template: "&lt;div&gt;IN DIRECTIVE&lt;/div&gt;"
  replace: true
  </code></pre>
  
  <p>My Html page calling the map:</p>
  
  <pre><code>#dashboard{ng:{controller: 'dashboardCtrl'}}
  
  
    #map.google-map{center:     'state.map.center',
                    zoom:       'state.map.zoom',
                    markers:    'state.map.markers',
                    draggable:  'true'}
  </code></pre>
  
  <p>And The DState Factory to define the state:</p>
  
  <pre><code>.factory 'DashboardState', (Media) -&gt;
    class DashboardState
      defaults:
        map:
          center:
            latitude:   45.764043
            longitude:  4.835659
          zoom: 10
          markers: []
        selectedObj: null
  
      constructor: (initialData) -&gt;
        _(@defaults).extend initialData
        _(this).extend @defaults
  </code></pre>
  
  <p>So, my display here in my infoWindow is </p>
  
  <blockquote>
    <p>SHOULD NOT DISPLAY CAUSE DIRECTIVE</p>
  </blockquote>
  
  <p>But I should have what is in my directive:</p>
  
  <blockquote>
    <p>IN DIRECTIVE</p>
  </blockquote>
  
  <p>My directive is not called ... Do you have an idea?</p>
  
  <p>It's a double question here, I would like to set the <strong>SelectedObj</strong> of my factory to the Obj himself. Do you have an Idea how to handle the event click on marker and where to place it to call the method who could assign my obj to SelectedObj?</p>
  
  <p>Thanks by advance</p>