title: function called twice inside angularjs controller
body: <p>I am new to angular js and currently stuck with very wired kind of a bug. function in a controllers runs twice when its called by view loaded against a route.</p>
  
  <p><a href="http://jsfiddle.net/4gwG3/5/">http://jsfiddle.net/4gwG3/5/</a></p>
  
  <p>you will see alert twice!!</p>
  
  <p>my view is simple<br>
      
      
      </p>
  
  <p>and my app code is following    </p>
  
  <pre><code>var IB = angular.module('IB', []);    
  
  //channel controller
  IB.controller('channelsController', function ($scope, $routeParams) {
      $scope.greet = function () {
          alert('hi');
      };
  });
  
  
  IB.config(function ($routeProvider) {
      $routeProvider
      .when('/channels', {
          controller: 'channelsController',
          template: '{{greet()}}'
      })
  
      .otherwise({ redirectTo: '/channels' });
  
  });
  </code></pre>