Skip to content

Commit 167bed0

Browse files
feat(module:alert): support standalone component (#8182)
* feat(module:alert): support standalone component * feat(module:alert): support standalone component
1 parent 4673926 commit 167bed0

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎components/alert/alert.component.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import { Direction, Directionality } from '@angular/cdk/bidi';
7+
import { NgIf } from '@angular/common';
78
import {
89
ChangeDetectionStrategy,
910
ChangeDetectorRef,
@@ -24,15 +25,19 @@ import { takeUntil } from 'rxjs/operators';
2425

2526
import { slideAlertMotion } from 'ng-zorro-antd/core/animation';
2627
import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';
28+
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
2729
import { BooleanInput } from 'ng-zorro-antd/core/types';
2830
import { InputBoolean } from 'ng-zorro-antd/core/util';
31+
import { NzIconModule } from 'ng-zorro-antd/icon';
2932

3033
const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'alert';
3134

3235
@Component({
3336
selector: 'nz-alert',
3437
exportAs: 'nzAlert',
3538
animations: [slideAlertMotion],
39+
standalone: true,
40+
imports: [NgIf, NzIconModule, NzOutletModule],
3641
template: `
3742
<div
3843
*ngIf="!closed"

‎components/alert/alert.module.ts‎

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

6-
import { BidiModule } from '@angular/cdk/bidi';
7-
import { CommonModule } from '@angular/common';
86
import { NgModule } from '@angular/core';
97

10-
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
11-
import { NzIconModule } from 'ng-zorro-antd/icon';
12-
138
import { NzAlertComponent } from './alert.component';
149

1510
@NgModule({
16-
declarations: [NzAlertComponent],
1711
exports: [NzAlertComponent],
18-
imports: [BidiModule, CommonModule, NzIconModule, NzOutletModule]
12+
imports: [NzAlertComponent]
1913
})
2014
export class NzAlertModule {}

‎components/alert/doc/index.en-US.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { NzAlertModule } from 'ng-zorro-antd/alert';
1818

1919
## API
2020

21-
### nz-alert
21+
### nz-alert:standalone
2222

2323
| Property | Description | Type | Default | Global Config |
2424
| -------- | ----------- | ---- | ------- | ------------- |

‎components/alert/doc/index.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { NzAlertModule } from 'ng-zorro-antd/alert';
1919

2020
## API
2121

22-
### nz-alert
22+
### nz-alert:standalone
2323

2424
| 参数 | 说明 | 类型 | 默认值 | 全局配置 |
2525
| --- | --- | --- | --- | --- |

0 commit comments

Comments
 (0)