title: password reset directive in Angular js
body: <p>I have to put validation in reset password form using Angular js.
  The following link helps my problem:-
  <a href="http://jsfiddle.net/lsiv568/aRN5h/8/" rel="nofollow">http://jsfiddle.net/lsiv568/aRN5h/8/</a></p>
  
  <p>but in this, the file which contains the directive is full of errors when we run in eclipse. Can anyone solve it, its just an error related to brackets. I am new to Angular JS, so unable to do this.</p>
  
  <p>The code which has errors is here:-</p>
  
  <pre><code>'use strict';
  
   app = angular.module('passwordMatchValidator', [])
   app.directive 'passwordMatch', -&gt;
   require: 'ngModel'
   link: (scope, elem, attrs, ctrl) -&gt;
  
    firstPasswordElement = angular.element(document.getElementById('password-to-verify'))
  
    checkMatch = -&gt;
      scope.$apply -&gt;
        valid = elem.val() is firstPasswordElement.val()
        ctrl.$setValidity 'passwordMatch', valid
  
    for theElement in [firstPasswordElement, elem]
      theElement.bind 'keyup', -&gt;
        checkMatch()
   app.controller 'FormCtrl', ($scope) -&gt;
   $scope.resetPassword = (password) -&gt;
   alert 'resetting password'
  
   angular.bootstrap document, ['passwordMatchValidator']`enter code here`
  </code></pre>