Skip to content

Commit

Permalink
refactor(module:divider): refactor control flow component (#8325)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoss54 committed Jan 4, 2024
1 parent 61c5f00 commit df766b6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions components/divider/divider.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { NgIf } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input, TemplateRef, ViewEncapsulation } from '@angular/core';

import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
Expand All @@ -17,9 +16,11 @@ import { InputBoolean } from 'ng-zorro-antd/core/util';
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<span *ngIf="nzText" class="ant-divider-inner-text">
<ng-container *nzStringTemplateOutlet="nzText">{{ nzText }}</ng-container>
</span>
@if (nzText) {
<span class="ant-divider-inner-text">
<ng-container *nzStringTemplateOutlet="nzText">{{ nzText }}</ng-container>
</span>
}
`,
host: {
class: 'ant-divider',
Expand All @@ -32,7 +33,7 @@ import { InputBoolean } from 'ng-zorro-antd/core/util';
'[class.ant-divider-with-text-center]': `nzText && nzOrientation === 'center'`,
'[class.ant-divider-dashed]': `nzDashed`
},
imports: [NgIf, NzOutletModule],
imports: [NzOutletModule],
standalone: true
})
export class NzDividerComponent {
Expand Down

0 comments on commit df766b6

Please sign in to comment.