import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NewsListComponent } from './news-list/news-list.component';
import { NewsMaterialModule } from './news-material.module';
import { Routes, RouterModule } from '@angular/router';
import { StoreModule } from '@ngrx/store';
import { newsReducers } from './store/news.reducers';
import { MomentModule } from 'ngx-moment';
import { NewsEditComponent } from './news-edit/news-edit.component';
import { ReactiveFormsModule } from '@angular/forms';
import { CKEditorModule } from '@ckeditor/ckeditor5-angular';


const routes: Routes = [
  { path: '', component: NewsListComponent, pathMatch: 'full' },
  { path: '/new', component: NewsEditComponent },
  { path: '/:id/', component: NewsEditComponent }
];

@NgModule({
  imports: [
    CommonModule,
    MomentModule,
    NewsMaterialModule,
    ReactiveFormsModule,
    CKEditorModule,
    RouterModule.forChild(routes),
    StoreModule.forFeature('news', newsReducers),
  ],
  declarations: [NewsListComponent, NewsEditComponent]
})
export class NewsModule { }
