title: What is canActivate and canDeactivate in routing?
body: <pre><code>import { Injectable } from '@angular/core';
  import { CanActivate } from '@angular/router';
  import { AuthService } from './auth.service';
  
  @Injectable()
  export class CanActivateViaAuthGuard implements CanActivate {
  
    constructor(private authService: AuthService) {}
  
    canActivate() {
      return this.authService.isLoggedIn();
    }
  } 
  </code></pre>
  
  <p>What is the meaning of <code>canActivate</code> and <code>canDeactivate</code> properties?</p>