title: Cannot read property 'toLowerCase' of undefined
body: <p>I'm having trouble with an an angular error message that i'm trying to work with. I am trying to ensure that a case insensitivity of a confirmation email does not apply to the initial email address. </p>
  
  <p>In my controller I was using the <code>toLowerCase()</code> filter....except for the fact that the console does not recognize this and is giving me an error message. </p>
  
  <p>My front end code is </p>
  
  <pre><code>input-md{ type: "email", "ng-model" =&gt; "vm.form.email_confirmation", required: true, 'must-match' =&gt; 'register_form["vm-form-email"]', 'match-case-insensitive' =&gt; true, 'ng-hide' =&gt; 'vm.form.validated_email', autocapitalize: 'off' }
  </code></pre>
  
  <p>and my controller, (and ultimately where the problem is)</p>
  
  <pre><code>getMatchValue = -&gt;
    match = matchGetter($scope)
    if (angular.isObject(match) and match.hasOwnProperty('$viewValue'))
      match = match.$viewValue
    match
  
  $scope.$watch getMatchValue, -&gt;
    ctrl.$$parseAndValidate()
    return
  
  ctrl.$validators.mustMatch = -&gt;
    match = getMatchValue()
  
    if $attrs.matchCaseInsensitive
      ctrl.$viewValue.toLowerCase() is match.toLowerCase()
    else
      ctrl.$viewValue is match
  return
  </code></pre>
  
  <p>If anybody could take a look at this, i would be greatly appreciated!</p>