title: Problem with validation form with Angular 7 and Nodejs
body: <p>i can´t make my form work correctly 
  the problem when i put my the validation the form i can´t make login work
  if remove the validation the login system work like charm
  i have this errors</p>
  
  <p>(node:9664) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'password' of null
      at app.post (F:\Projecto\GestStocks\Server\index.js:23:41)
      at process._tickCallback (internal/process/next_tick.js:68:7)
  (node:9664) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
  (node:9664) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  (node:9664) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'password' of null
      at app.post (F:\Projecto\GestStocks\Server\index.js:23:41)
      at process._tickCallback (internal/process/next_tick.js:68:7)
  (node:9664) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)</p>
  
  <p>this is my code </p>
  
  <pre><code>ngOnInit() {
  var runLoginValidator = function() {
  var form = $('.form-login');
   var errorHandler = $('.errorHandler', form);
        form.validate({
          rules : {
            username : {
              minlength : 4,
              required : true
            },
            password : {
              minlength : 8,
              required : true
            }
          },
          submitHandler : function(form) {
            errorHandler.hide();
            //form.submit();
          },
          invalidHandler : function(event, validator) {//display error alert on form submit
            errorHandler.show();
          }
        });
      };
    runLoginValidator();
  
  }
  
  loginuser(event){
    event.preventDefault();
  const target = event.target
  const username= target.querySelector('#username').value
  const password= target.querySelector('#password').value
  this.Auth.getUserDetails(username,password).subscribe(data =&gt;{
    if(data.success){
  this.router.navigate(['homepage'])
  this.Auth.setLoggedIn(true)
    }else{
      window.alert(data.message)
    }
  })
  
  }
    &lt;form class="form-login" (submit)="loginuser($event)"&gt;
            &lt;div class="form-group"&gt;
              &lt;span class="input-icon"&gt;
                &lt;input type="text" class="form-control" name="username" placeholder="Username" id="username"&gt;
                &lt;i class="fa fa-user"&gt;&lt;/i&gt; &lt;/span&gt;
            &lt;/div&gt;
            &lt;div class="form-group form-actions"&gt;
              &lt;span class="input-icon"&gt;
                &lt;input type="password" class="form-control password" id="password" name="password" placeholder="Password"&gt;
                &lt;i class="fa fa-lock"&gt;&lt;/i&gt;
                &lt;a class="forgot" href="#forgot"&gt;
                  I forgot my password
                &lt;/a&gt;
               &lt;/span&gt;
            &lt;/div&gt;
  
              &lt;button type="submit" class="btn btn-primary pull-right"&gt;
                Login &lt;i class="fa fa-arrow-circle-right"&gt;&lt;/i&gt;
              &lt;/button&gt;
            &lt;/div&gt;
  
        &lt;/form&gt;
  </code></pre>