This repository has been archived on 2025-11-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
city-tracker/apps/frontend/src/app/modules/comment/comment.module.ts
T
2023-05-27 08:51:06 +02:00

36 lines
1.2 KiB
TypeScript

import { CommonModule } from '@angular/common';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { ButtonModule } from 'primeng/button';
import { CardModule } from 'primeng/card';
import { InputTextModule } from 'primeng/inputtext';
import { InputTextareaModule } from 'primeng/inputtextarea';
import { CommentFormComponent } from './components/comment-form/comment-form.component';
import { CommentComponent } from './components/comment/comment.component';
import { CommentsComponent } from './components/comments/comments.component';
import { CommentService, commentTypeToken } from './services/comment.service';
@NgModule({
declarations: [CommentsComponent, CommentComponent, CommentFormComponent],
imports: [
CommonModule,
CardModule,
InputTextModule,
ButtonModule,
InputTextareaModule,
ReactiveFormsModule,
],
exports: [CommentsComponent],
providers: [CommentService],
})
export class CommentModule {
static forRoot(
commentType: 'solution' | 'issues'
): ModuleWithProviders<CommentModule> {
return {
ngModule: CommentModule,
providers: [{ provide: commentTypeToken, useValue: commentType }],
};
}
}