import { NgModule } from '@angular/core' ; import { RouterModule , Routes } from '@angular/router' ; import { AdminGuard } from '@app/core/guards/admin.guard' ; import { UsersListComponent } from './users-list/users-list.component' ; const routes = [ { path : 'users' , component : UsersListComponent , canActivate : [ AdminGuard ] , } , ] ; @ NgModule ( { imports : [ RouterModule . forChild ( routes ) ] , exports : [ RouterModule ] , } ) export class AdminRoutingModule { }