title: angularjs controller executes twice
body: <p>A similar question was asked <a href="https://stackoverflow.com/questions/15535336/combating-angularjs-executing-controller-twice">here</a> but it did not help me.</p>
  
  <p>I am learning angularjs and I noticed the controller is executed twice.</p>
  
  <p>I have a very simple fiddle example that shows the behavior <a href="http://jsfiddle.net/fabregat/PnaKx/" rel="nofollow noreferrer">here</a></p>
  
  <p>I built the example as I was learning about services and at first I thought it was the injecting of the services into the controller but I commented all the code related to the services and still the controller is executed twice.</p>
  
  <p>My example works but I am afraid I am doing something wrong.</p>
  
  <pre><code>&lt;div ng-app="MyApp"&gt;
    &lt;div ng-controller="MyCtrl"&gt;
      {{data1}} 
    &lt;/div&gt;
  &lt;/div&gt;
  
  var app = angular.module('MyApp', [])
  app.service('Service1', function(){
    return {
      ajxResponse1: 'dataFromService1'
    };
   });
  
  function MyCtrl($scope, Service1){
    alert('Entering MyCtrl');
    $scope.data1 = Service1.ajxResponse1;    
    alert('Exiting MyCtrl');
  }
  </code></pre>