ng-click directive is not calling the entire function
<p>I'm trying to move a marker inside the google maps map. I have a function to move them and they are working fine. For testing, I had invoked them inside the script and they are working as expected. </p>

<p>But when I am trying to call the function within the ng-click directive, the function is getting called but the entire code is not being executed.</p>

<pre><code>&lt;md-button class="md-raised md-primary" ng-click="x()"&gt;Click here to move the marker&lt;/md-button&gt;
</code></pre>

<p>Method:</p>

<pre><code>$scope.x = function ()
      {
        console.log('a');
          $scope.marker = {
          id: 6,
          coords: {latitude:-28.226349,longitude:-52.381581}
          };
      }
</code></pre>

<p>Inside the console the 'a' is getting printed, but the marker doesn't move to latitude: -28.226349, longitude: -52.381581.</p>

<p>If I call the function inside the script like this:</p>

<pre><code>$scope.x = function ()
      {
        console.log('a');
          $scope.marker = {
          id: 6,
          coords: {latitude:-28.226349,longitude:-52.381581}
          };
      }

      $scope.x();
</code></pre>

<p>When the page is loaded, the marker is at latitude: -28.226349, longitude: -52.381581.</p>

<p>Entire HTML:</p>

<pre><code>&lt;md-button class="md-raised md-primary" ng-click="x()"&gt;Click here to move the marker&lt;/md-button&gt;
&lt;div id="map" ng-controller="MapCtrl"&gt;
&lt;ui-gmap-google-map center='map.center' zoom='map.zoom'  options="map.options"&gt;

&lt;ui-gmap-marker coords="marker.coords" options="marker.options" events="marker.events" idkey="6"&gt;&lt;/ui-gmap-marker&gt;

&lt;/ui-gmap-google-map&gt;
</code></pre>

<p></p>