title: Angular ng-if throwing TypeError: Cannot read property '0' of null
body: <p>I am trying to show and hide html using ng-if . When the $scope.isTokenValid is false, it works fine.But when $scope.isTokenValid  is true I am getting below error. Please help</p>
  
  <pre><code>TypeError: Cannot read property '0' of null
      at $parseFunctionCall (angular.js:12346)
      at Object.expressionInputWatch (angular.js:12754)
      at Scope.$get.Scope.$digest (angular.js:14235)
      at Scope.$get.Scope.$apply (angular.js:14506)
      at done (angular.js:9659)
      at completeRequest (angular.js:9849)
      at XMLHttpRequest.requestLoaded (angular.js:9790)
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>angular.module('clientApp')
      .controller('RegCtrl', function($scope, $routeParams, $http) {
      var url = "http://localhost:3000/signup/" + $routeParams.invitation_token;
      $http.get(url)
          .success(function(response) {
              $scope.isTokenValid = response.isValid;
          })
  });
  </code></pre>
  
  <p>View</p>
  
  <pre><code>&lt;div class="row" ng-if="isTokenValid()"&gt;
       &lt;h1&gt;Valid&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div class="row" ng-if="!isTokenValid()"&gt;
       &lt;h1&gt;InValid&lt;/h1&gt;
  &lt;/div&gt;
  </code></pre>