title: Undefined or null for AngularJS
body: <p>When I write watch handling functions I check newVal param on <code>undefined</code> and <code>null</code>. Why does AngularJS have such a behavior, but doesn't have particular utility method? So there is <code>angular.isUndefined</code> but not <code>angular.isUndefinedOrNull</code>. It isn't hard to implement that by hand but how extend angular to have that function in each controller? Tnx.</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>The example:</p>
  
  <pre><code>$scope.$watch("model", function(newVal) {
      if (angular.isUndefined(newVal) || newVal == null) return;
      // do somethings with newVal
  }
  </code></pre>
  
  <p>Is it common accepted practice to handle such a way?</p>
  
  <p><strong>Edit 2</strong>:</p>
  
  <p>The JSFiddle example (<a href="http://jsfiddle.net/ubA9r/">http://jsfiddle.net/ubA9r/</a>):</p>
  
  <pre><code>&lt;div ng-app="App"&gt;
    &lt;div ng-controller="MainCtrl"&gt; 
        &lt;select ng-model="model" ng-options="m for m in models"&gt;
            &lt;option value="" class="ng-binding"&gt;Choose model&lt;/option&gt;
        &lt;/select&gt;
        {{model}}
    &lt;/div&gt;
  &lt;/div&gt;
  
  var app = angular.module("App", []);
  
  var MainCtrl = function($scope) {
      $scope.models = ['Apple', 'Banana'];
      $scope.$watch("model", function(newVal) {
          console.log(newVal);
      });
  };
  </code></pre>