Skip to content

Commit df766b6

Browse files
authored
refactor(module:divider): refactor control flow component (#8325)
1 parent 61c5f00 commit df766b6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

components/divider/divider.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
44
*/
55

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

98
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
@@ -17,9 +16,11 @@ import { InputBoolean } from 'ng-zorro-antd/core/util';
1716
encapsulation: ViewEncapsulation.None,
1817
changeDetection: ChangeDetectionStrategy.OnPush,
1918
template: `
20-
<span *ngIf="nzText" class="ant-divider-inner-text">
21-
<ng-container *nzStringTemplateOutlet="nzText">{{ nzText }}</ng-container>
22-
</span>
19+
@if (nzText) {
20+
<span class="ant-divider-inner-text">
21+
<ng-container *nzStringTemplateOutlet="nzText">{{ nzText }}</ng-container>
22+
</span>
23+
}
2324
`,
2425
host: {
2526
class: 'ant-divider',
@@ -32,7 +33,7 @@ import { InputBoolean } from 'ng-zorro-antd/core/util';
3233
'[class.ant-divider-with-text-center]': `nzText && nzOrientation === 'center'`,
3334
'[class.ant-divider-dashed]': `nzDashed`
3435
},
35-
imports: [NgIf, NzOutletModule],
36+
imports: [NzOutletModule],
3637
standalone: true
3738
})
3839
export class NzDividerComponent {

0 commit comments

Comments
 (0)