[ACA-4650] Use NodeCommentsService for ADF_COMMENTS_SERVICE (#8169)

* ACA-4650 Use NodeCommentsService for ADF_COMMENTS_SERVICE

* ACA-4650 Register services at component level
This commit is contained in:
AleksanderSklorz 2023-01-19 15:48:55 +01:00 committed by GitHub
parent 491d16f562
commit 570bfb235c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 20 deletions

View File

@ -16,11 +16,17 @@
*/
import { Component, Input, ViewEncapsulation } from '@angular/core';
import { ADF_COMMENTS_SERVICE } from '@alfresco/adf-core';
import { NodeCommentsService } from './services/node-comments.service';
@Component({
selector: 'adf-node-comments',
templateUrl: './node-comments.component.html',
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
providers: [{
provide: ADF_COMMENTS_SERVICE,
useClass: NodeCommentsService
}]
})
export class NodeCommentsComponent {
@Input()

View File

@ -18,8 +18,7 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NodeCommentsComponent } from './node-comments.component';
import { ADF_COMMENTS_SERVICE, CoreModule } from '@alfresco/adf-core';
import { NodeCommentsService } from './services/node-comments.service';
import { CoreModule } from '@alfresco/adf-core';
@NgModule({
imports: [
@ -27,12 +26,6 @@ import { NodeCommentsService } from './services/node-comments.service';
CoreModule
],
declarations: [NodeCommentsComponent],
exports: [NodeCommentsComponent],
providers: [
{
provide: ADF_COMMENTS_SERVICE,
useClass: NodeCommentsService
}
]
exports: [NodeCommentsComponent]
})
export class NodeCommentsModule {}

View File

@ -16,11 +16,17 @@
*/
import { Component, Input, ViewEncapsulation } from '@angular/core';
import { ADF_COMMENTS_SERVICE } from '@alfresco/adf-core';
import { TaskCommentsService } from './services/task-comments.service';
@Component({
selector: 'adf-task-comments',
templateUrl: './task-comments.component.html',
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
providers: [{
provide: ADF_COMMENTS_SERVICE,
useClass: TaskCommentsService
}]
})
export class TaskCommentsComponent {
@Input()

View File

@ -18,8 +18,7 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TaskCommentsComponent } from './task-comments.component';
import { TaskCommentsService } from './services/task-comments.service';
import { ADF_COMMENTS_SERVICE, CoreModule } from '@alfresco/adf-core';
import { CoreModule } from '@alfresco/adf-core';
@NgModule({
imports: [
@ -27,12 +26,6 @@ import { ADF_COMMENTS_SERVICE, CoreModule } from '@alfresco/adf-core';
CoreModule
],
declarations: [TaskCommentsComponent],
exports: [TaskCommentsComponent],
providers: [
{
provide: ADF_COMMENTS_SERVICE,
useClass: TaskCommentsService
}
]
exports: [TaskCommentsComponent]
})
export class TaskCommentsModule {}