Skip to content

Commit 0888438

Browse files
alinelariguetjhonyeduardo
authored andcommitted
fix(rich-text): corrige compartilhamento do ngModel
Corrige o compartilhamento do ngModel quando tem mais do que um po-rich-text por página. Fixes: DTHFUI-4248
1 parent 51c70de commit 0888438

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text-body/po-rich-text-body.component.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as UtilsFunction from '../../../../utils/util';
66
import { configureTestSuite } from './../../../../util-test/util-expect.spec';
77

88
import { PoRichTextBodyComponent } from './po-rich-text-body.component';
9+
import { PoRichTextService } from '../po-rich-text.service';
910

1011
describe('PoRichTextBodyComponent:', () => {
1112
let component: PoRichTextBodyComponent;
@@ -14,7 +15,8 @@ describe('PoRichTextBodyComponent:', () => {
1415

1516
configureTestSuite(() => {
1617
TestBed.configureTestingModule({
17-
declarations: [PoRichTextBodyComponent]
18+
declarations: [PoRichTextBodyComponent],
19+
providers: [PoRichTextService]
1820
});
1921
});
2022

projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ const providers = [
1919
// tslint:disable-next-line
2020
useExisting: forwardRef(() => PoRichTextComponent),
2121
multi: true
22+
},
23+
{
24+
provide: PoRichTextService
2225
}
2326
];
2427

projects/ui/src/lib/components/po-field/po-rich-text/po-rich-text.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { Injectable } from '@angular/core';
22

33
import { Subject } from 'rxjs';
44

5-
@Injectable({
6-
providedIn: 'root'
7-
})
5+
@Injectable()
86
export class PoRichTextService {
97
private model = new Subject<string>();
108

0 commit comments

Comments
 (0)