I receive & ldquo; Property 'router' does not exist on type 'SigninComponent'. & Quot; using this.router.navigate (['/ dashboard']); in angular 4

advertisements

I have import :

import { RouterModule, Routes} from '@angular/router';

and then I have used below line in my function inside component

this.router.navigate(['/dashboard']);


/* Missing if you are using 'this.router.navigate' */   

import { Router } from '@angular/router';