From db74ec2dbce70a411adc701021f959da23302d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:57:44 +0300 Subject: [PATCH] Fixed #15013 --- src/app/components/card/card.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/components/card/card.ts b/src/app/components/card/card.ts index d81c1f6a1a2..3f92c93051f 100755 --- a/src/app/components/card/card.ts +++ b/src/app/components/card/card.ts @@ -1,6 +1,7 @@ import { CommonModule } from '@angular/common'; -import { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, ContentChildren, ElementRef, Input, NgModule, QueryList, TemplateRef, ViewEncapsulation } from '@angular/core'; +import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, ElementRef, Input, NgModule, QueryList, SimpleChange, TemplateRef, ViewEncapsulation, signal } from '@angular/core'; import { BlockableUI, Footer, Header, PrimeTemplate, SharedModule } from 'primeng/api'; +import { ObjectUtils } from '../utils/objectutils'; /** * Card is a flexible container component. * @group Components @@ -8,7 +9,7 @@ import { BlockableUI, Footer, Header, PrimeTemplate, SharedModule } from 'primen @Component({ selector: 'p-card', template: ` -
+
@@ -55,7 +56,11 @@ export class Card implements AfterContentInit, BlockableUI { * Inline style of the element. * @group Props */ - @Input() style: { [klass: string]: any } | null | undefined; + @Input() set style(value: { [klass: string]: any } | null | undefined) { + if (!ObjectUtils.equals(this._style(), value)) { + this._style.set(value); + } + } /** * Class of the element. * @group Props @@ -78,6 +83,8 @@ export class Card implements AfterContentInit, BlockableUI { footerTemplate: TemplateRef | undefined; + _style = signal<{ [klass: string]: any } | null | undefined>(null); + constructor(private el: ElementRef) {} ngAfterContentInit() {