Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a863c1

Browse files
committed
fix(popover): use afterRenderEffect() instead of effect() to avoid NG0500: During hydration expected...
1 parent8f77e2d commit0a863c1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎projects/coreui-angular/src/lib/popover/popover.directive.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import{
2+
afterRenderEffect,
23
AfterViewInit,
34
ChangeDetectorRef,
45
ComponentRef,
@@ -100,8 +101,12 @@ export class PopoverDirective implements OnDestroy, OnInit, AfterViewInit {
100101
*/
101102
readonlyvisible=model(false,{alias:'cPopoverVisible'});
102103

103-
readonly #visibleEffect=effect(()=>{
104-
this.visible() ?this.addTooltipElement() :this.removeTooltipElement();
104+
readonly #visibleEffect=afterRenderEffect({
105+
// this fixes RuntimeError: NG0500: During hydration Angular expected <abc> but found <xyz>.
106+
// Find more at https://angular.dev/errors/NG0500
107+
write:()=>{
108+
this.visible() ?this.addTooltipElement() :this.removeTooltipElement();
109+
}
105110
});
106111

107112
getariaDescribedBy():string|null{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp