import { BrowserModule } from '@angular/platform-browser' ; import { NgModule } from '@angular/core' ; import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ; import { MatButtonModule , MatGridListModule , MatIconModule , MatListModule , MatMenuModule , MatToolbarModule } from '@angular/material' ; import { RouterModule , Routes } from '@angular/router' ; import { FormsModule } from '@angular/forms' ; import { ChatsService } from '../services/chats.service' ; import { ChatComponent } from './containers/chat/chat.component' ; import { MessagesListComponent } from './components/messages-list/messages-list.component' ; import { MessageItemComponent } from './components/message-item/message-item.component' ; import { NewMessageComponent } from './components/new-message/new-message.component' ; import { SharedModule } from '../shared/shared.module' ; import { NgxSelectableListModule } from 'ngx-selectable-list' ; import { AuthGuard } from '../login/services/auth.guard' ; const routes = [ { path : 'chat' , children : [ { path : ':id' , canActivate : [ AuthGuard ] , component : ChatComponent } , ] , } , ] ; @ NgModule ( { declarations : [ ChatComponent , MessagesListComponent , MessageItemComponent , NewMessageComponent , ] , imports : [ BrowserModule , MatToolbarModule , MatMenuModule , MatIconModule , MatButtonModule , MatListModule , MatGridListModule , BrowserAnimationsModule , RouterModule . forChild ( routes ) , FormsModule , SharedModule , NgxSelectableListModule , ] , providers : [ ChatsService , ] , } ) export class ChatViewerModule { }