Skip to content

Commit

Permalink
we can use host property to extend more class attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Ben Makhlouf committed Oct 13, 2024
1 parent 71b38b7 commit 29b7942
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app/components/divider/divider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule, Component, ChangeDetectionStrategy, ViewEncapsulation, input, inject, HostBinding } from '@angular/core';
import { NgModule, Component, ChangeDetectionStrategy, ViewEncapsulation, input, inject } from '@angular/core';
import { BaseComponent } from 'primeng/basecomponent';
import { DividerStyle } from './style/dividerstyle';
/**
Expand Down Expand Up @@ -29,6 +29,7 @@ import { DividerStyle } from './style/dividerstyle';
'[class.p-divider-top]': 'layout() === "vertical" && align() === "top"',
'[class.p-divider-bottom]': 'layout() === "vertical" && align() === "bottom"',
'[style]': 'style()',
'[class]': 'styleClass()',
'[attr.aria-orientation]': 'layout()',
'[attr.data-pc-name]': "'divider'",
'[attr.role]': '"separator"',
Expand Down Expand Up @@ -67,10 +68,6 @@ export class Divider extends BaseComponent {
align = input<'left' | 'right' | 'top' | 'center' | 'bottom'>();

_componentStyle = inject(DividerStyle);

@HostBinding('class') get hostClass() {
return this.styleClass();
}
}

@NgModule({
Expand Down

0 comments on commit 29b7942

Please sign in to comment.