diff --git a/.eslintrc.js b/.eslintrc.js
index ec272ae71f..659960753c 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -178,7 +178,9 @@ module.exports = {
{
files: ['*.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
- rules: {}
+ rules: {
+ "@angular-eslint/template/prefer-self-closing-tags": "error"
+ }
},
{
files: ['*.html'],
diff --git a/packages/abc/avatar-list/avatar-list-item.component.ts b/packages/abc/avatar-list/avatar-list-item.component.ts
index 942e4add51..f90a9f4b2f 100644
--- a/packages/abc/avatar-list/avatar-list-item.component.ts
+++ b/packages/abc/avatar-list/avatar-list-item.component.ts
@@ -3,7 +3,7 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a
@Component({
selector: 'avatar-list-item, [avatar-list-item]',
exportAs: 'avatarListItem',
- template: ``,
+ template: ``,
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
diff --git a/packages/abc/avatar-list/avatar-list.component.html b/packages/abc/avatar-list/avatar-list.component.html
index baf6e43d4d..0e724cbbeb 100644
--- a/packages/abc/avatar-list/avatar-list.component.html
+++ b/packages/abc/avatar-list/avatar-list.component.html
@@ -8,15 +8,10 @@
[nzText]="i.text"
[nzIcon]="i.icon"
[nzSize]="avatarSize"
- >
-
+ />
+
0" [ngClass]="cls">
-
+
diff --git a/packages/abc/avatar-list/avatar-list.spec.ts b/packages/abc/avatar-list/avatar-list.spec.ts
index 1fd4282175..6b8e753acc 100644
--- a/packages/abc/avatar-list/avatar-list.spec.ts
+++ b/packages/abc/avatar-list/avatar-list.spec.ts
@@ -68,20 +68,11 @@ describe('abc: avatar-list', () => {
@Component({
template: `
-
-
-
-
-
+
+
+
+
+
`
})
diff --git a/packages/abc/count-down/count-down.component.ts b/packages/abc/count-down/count-down.component.ts
index 976f72f549..233ac2bc9a 100644
--- a/packages/abc/count-down/count-down.component.ts
+++ b/packages/abc/count-down/count-down.component.ts
@@ -14,7 +14,7 @@ import { CountdownComponent, CountdownConfig, CountdownEvent } from 'ngx-countdo
@Component({
selector: 'count-down',
exportAs: 'countDown',
- template: ` `,
+ template: ``,
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
diff --git a/packages/abc/count-down/count-down.spec.ts b/packages/abc/count-down/count-down.spec.ts
index 095b4c26f0..d746d318e8 100644
--- a/packages/abc/count-down/count-down.spec.ts
+++ b/packages/abc/count-down/count-down.spec.ts
@@ -51,10 +51,10 @@ describe('abc: count-down', () => {
@Component({
template: `
-
+
-
+
`
})
diff --git a/packages/abc/date-picker/range.directive.spec.ts b/packages/abc/date-picker/range.directive.spec.ts
index 25d5ba7bf0..686a4e4ab3 100644
--- a/packages/abc/date-picker/range.directive.spec.ts
+++ b/packages/abc/date-picker/range.directive.spec.ts
@@ -117,7 +117,7 @@ describe('abc: date-picker: nz-range-picker[extend]', () => {
extend
[(ngModelEnd)]="i.end"
[shortcut]="shortcut"
- >
+ />
`
})
class TestComponent {
diff --git a/packages/abc/ellipsis/ellipsis.component.html b/packages/abc/ellipsis/ellipsis.component.html
index e5a7b03a67..dfdc9fa0b5 100644
--- a/packages/abc/ellipsis/ellipsis.component.html
+++ b/packages/abc/ellipsis/ellipsis.component.html
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/packages/abc/error-collect/error-collect.spec.ts b/packages/abc/error-collect/error-collect.spec.ts
index 091406de31..840dcdcc9a 100644
--- a/packages/abc/error-collect/error-collect.spec.ts
+++ b/packages/abc/error-collect/error-collect.spec.ts
@@ -80,7 +80,7 @@ describe('abc: error-collect', () => {
it('should be throw [No found form element] if no form element', () => {
expect(() => {
- TestBed.overrideTemplate(TestComponent, ``)
+ TestBed.overrideTemplate(TestComponent, ``)
.createComponent(TestComponent)
.detectChanges();
}).toThrowError('No found form element');
@@ -95,7 +95,7 @@ describe('abc: error-collect', () => {
-
+
`
})
diff --git a/packages/abc/exception/exception.component.html b/packages/abc/exception/exception.component.html
index 919e0260a4..711fe8a2e4 100644
--- a/packages/abc/exception/exception.component.html
+++ b/packages/abc/exception/exception.component.html
@@ -6,7 +6,7 @@
-
+
diff --git a/packages/abc/footer-toolbar/footer-toolbar.spec.ts b/packages/abc/footer-toolbar/footer-toolbar.spec.ts
index d6c799c1b7..2d6139dd4a 100644
--- a/packages/abc/footer-toolbar/footer-toolbar.spec.ts
+++ b/packages/abc/footer-toolbar/footer-toolbar.spec.ts
@@ -58,7 +58,7 @@ describe('abc: footer-toolbar', () => {
});
@Component({
- template: ` `
+ template: ` `
})
class TestComponent {
errorCollect = true;
diff --git a/packages/abc/full-content/full-content.component.ts b/packages/abc/full-content/full-content.component.ts
index e38215e25d..dd3675fe7b 100644
--- a/packages/abc/full-content/full-content.component.ts
+++ b/packages/abc/full-content/full-content.component.ts
@@ -32,7 +32,7 @@ const hideTitleCls = `full-content__hidden-title`;
@Component({
selector: 'full-content',
exportAs: 'fullContent',
- template: ` `,
+ template: ` `,
host: {
'[class.full-content]': 'true',
'[style.height.px]': '_height'
diff --git a/packages/abc/global-footer/global-footer-item.component.ts b/packages/abc/global-footer/global-footer-item.component.ts
index 3ada5495ec..ead0a6e386 100644
--- a/packages/abc/global-footer/global-footer-item.component.ts
+++ b/packages/abc/global-footer/global-footer-item.component.ts
@@ -5,7 +5,7 @@ import { BooleanInput, InputBoolean } from '@delon/util/decorator';
@Component({
selector: 'global-footer-item',
exportAs: 'globalFooterItem',
- template: ` `,
+ template: ` `,
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
diff --git a/packages/abc/global-footer/global-footer.component.html b/packages/abc/global-footer/global-footer.component.html
index 08de652c4f..b7cd71f70d 100644
--- a/packages/abc/global-footer/global-footer.component.html
+++ b/packages/abc/global-footer/global-footer.component.html
@@ -1,9 +1,9 @@
0 || items.length > 0" class="global-footer__links">
diff --git a/packages/abc/loading/loading.component.html b/packages/abc/loading/loading.component.html
index 0c7347dc87..10a7170a14 100644
--- a/packages/abc/loading/loading.component.html
+++ b/packages/abc/loading/loading.component.html
@@ -1,6 +1,6 @@
-
+
diff --git a/packages/abc/media/media.component.ts b/packages/abc/media/media.component.ts
index 715d787a0f..efd84254f4 100644
--- a/packages/abc/media/media.component.ts
+++ b/packages/abc/media/media.component.ts
@@ -31,7 +31,7 @@ export type MediaType = 'html5' | 'youtube' | 'video' | 'audio';
@Component({
selector: 'media',
exportAs: 'mediaComponent',
- template: `
`,
+ template: `
`,
host: {
'[style.display]': `'block'`
},
diff --git a/packages/abc/media/media.spec.ts b/packages/abc/media/media.spec.ts
index d25e4316c8..bf4ab07823 100644
--- a/packages/abc/media/media.spec.ts
+++ b/packages/abc/media/media.spec.ts
@@ -102,10 +102,11 @@ describe('abc: media', () => {
}
});
+// NOTE:
当前不管是否有禁用eslint标签都会导致强制自关闭
@Component({
- template: `
-
- `
+ template: `
+
+ `
})
class TestComponent {
@ViewChild('comp') comp!: MediaComponent;
@@ -116,7 +117,6 @@ class TestComponent {
ready(): void {}
}
@Component({
- template: `
-
`
+ template: `
`
})
class TestCustomVideoComponent extends TestComponent {}
diff --git a/packages/abc/notice-icon/notice-icon-tab.component.html b/packages/abc/notice-icon/notice-icon-tab.component.html
index d49ec99f15..d81f604bdb 100644
--- a/packages/abc/notice-icon/notice-icon-tab.component.html
+++ b/packages/abc/notice-icon/notice-icon-tab.component.html
@@ -12,18 +12,18 @@
- {{
- item.title
- }}
+
+ {{ item.title }}
+
- {{
- item.description
- }}
+
+ {{ item.description }}
+
{{ item.datetime }}
diff --git a/packages/abc/notice-icon/notice-icon.component.html b/packages/abc/notice-icon/notice-icon.component.html
index 2a596a4e25..9a4fa89c07 100644
--- a/packages/abc/notice-icon/notice-icon.component.html
+++ b/packages/abc/notice-icon/notice-icon.component.html
@@ -4,7 +4,7 @@
-
+
0"
@@ -16,18 +16,13 @@
[nzOverlayClassName]="overlayCls"
[nzDropdownMenu]="noticeMenu"
>
-
+
-
+
diff --git a/packages/abc/notice-icon/notice-icon.spec.ts b/packages/abc/notice-icon/notice-icon.spec.ts
index b2e99a29e0..2f1d7a2f7c 100644
--- a/packages/abc/notice-icon/notice-icon.spec.ts
+++ b/packages/abc/notice-icon/notice-icon.spec.ts
@@ -137,7 +137,7 @@ describe('abc: notice-icon', () => {
(clear)="clear($event)"
[(popoverVisible)]="popoverVisible"
(popoverVisibleChange)="popupVisibleChange($event)"
- >
+ />
`
})
class TestComponent {
diff --git a/packages/abc/page-header/page-header.component.html b/packages/abc/page-header/page-header.component.html
index 52cb9dcb90..81fe8575bd 100644
--- a/packages/abc/page-header/page-header.component.html
+++ b/packages/abc/page-header/page-header.component.html
@@ -1,5 +1,5 @@
-
+
diff --git a/packages/abc/page-header/page-header.spec.ts b/packages/abc/page-header/page-header.spec.ts
index 1a9c9449b1..3dc964338a 100644
--- a/packages/abc/page-header/page-header.spec.ts
+++ b/packages/abc/page-header/page-header.spec.ts
@@ -463,13 +463,7 @@ class TestComponent extends TestBaseComponent {}
@Component({
template: `
-
+
`
})
class TestAutoBreadcrumbComponent extends TestBaseComponent {}
@@ -483,7 +477,7 @@ class TestAutoBreadcrumbComponent extends TestBaseComponent {}
[homeI18n]="homeI18n"
[homeLink]="homeLink"
[autoBreadcrumb]="autoBreadcrumb"
- >
+ />
`
})
class TestI18nComponent extends TestBaseComponent {}
diff --git a/packages/abc/pdf/pdf.component.ts b/packages/abc/pdf/pdf.component.ts
index 6a7ea91ba5..be89dc1bb2 100644
--- a/packages/abc/pdf/pdf.component.ts
+++ b/packages/abc/pdf/pdf.component.ts
@@ -43,7 +43,7 @@ const BORDER_WIDTH = 9;
selector: 'pdf',
exportAs: 'pdf',
template: `
-
+
diff --git a/packages/abc/pdf/pdf.spec.ts b/packages/abc/pdf/pdf.spec.ts
index db5f4e6913..dde97b4ca1 100644
--- a/packages/abc/pdf/pdf.spec.ts
+++ b/packages/abc/pdf/pdf.spec.ts
@@ -44,7 +44,7 @@ describe('abc: pdf', () => {
});
@Component({
- template: ` `
+ template: ` `
})
class TestComponent {
@ViewChild('comp') comp!: PdfComponent;
diff --git a/packages/abc/qr/qr.spec.ts b/packages/abc/qr/qr.spec.ts
index 154ffcdfd4..b475a01882 100644
--- a/packages/abc/qr/qr.spec.ts
+++ b/packages/abc/qr/qr.spec.ts
@@ -104,7 +104,7 @@ describe('abc: qr', () => {
[padding]="padding"
[size]="size"
(change)="change($event)"
- >
+ />
`
})
class TestComponent {
diff --git a/packages/abc/quick-menu/quick-menu.component.html b/packages/abc/quick-menu/quick-menu.component.html
index e2a323d5d9..e3342dbca6 100644
--- a/packages/abc/quick-menu/quick-menu.component.html
+++ b/packages/abc/quick-menu/quick-menu.component.html
@@ -6,5 +6,5 @@
-
+
diff --git a/packages/abc/quick-menu/quick-menu.spec.ts b/packages/abc/quick-menu/quick-menu.spec.ts
index c978a149fd..9389d1cb41 100644
--- a/packages/abc/quick-menu/quick-menu.spec.ts
+++ b/packages/abc/quick-menu/quick-menu.spec.ts
@@ -81,7 +81,7 @@ describe('abc: quick-menu', () => {
[borderColor]="borderColor"
[expand]="expand"
(expandChange)="expandChange()"
- >
+ />
`
})
class TestComponent {
diff --git a/packages/abc/result/result.component.html b/packages/abc/result/result.component.html
index e5a1aa659b..1902b77f1d 100644
--- a/packages/abc/result/result.component.html
+++ b/packages/abc/result/result.component.html
@@ -11,5 +11,5 @@
{{ extra }}
-
+
diff --git a/packages/abc/result/result.spec.ts b/packages/abc/result/result.spec.ts
index 475349fe41..b3ea230b87 100644
--- a/packages/abc/result/result.spec.ts
+++ b/packages/abc/result/result.spec.ts
@@ -104,7 +104,7 @@ describe('abc: result', () => {
@Component({
template: `
-
+
titleTpl
descriptionTpl
diff --git a/packages/abc/reuse-tab/reuse-tab.component.html b/packages/abc/reuse-tab/reuse-tab.component.html
index 6266a891f2..8027db9e87 100644
--- a/packages/abc/reuse-tab/reuse-tab.component.html
+++ b/packages/abc/reuse-tab/reuse-tab.component.html
@@ -20,7 +20,7 @@
*ngIf="titleRender; else defaultTitle"
[ngTemplateOutlet]="titleRender"
[ngTemplateOutletContext]="{ $implicit: i }"
- >
+ />
{{ i.title }}
@@ -28,4 +28,4 @@
-
+
diff --git a/packages/abc/reuse-tab/reuse-tab.component.spec.ts b/packages/abc/reuse-tab/reuse-tab.component.spec.ts
index 0210d123dc..0ba445f44d 100644
--- a/packages/abc/reuse-tab/reuse-tab.component.spec.ts
+++ b/packages/abc/reuse-tab/reuse-tab.component.spec.ts
@@ -839,7 +839,7 @@ describe('abc: reuse-tab', () => {
d
e
leave
-
+
`
})
class AppComponent {}
@@ -866,9 +866,8 @@ class AppComponent {}
[canClose]="canClose"
(change)="change($event)"
(close)="close($event)"
- >
-
-
+ />
+
{{ i.url }}
`
})
diff --git a/packages/abc/se/se-container.component.ts b/packages/abc/se/se-container.component.ts
index 39b7e5985c..82b5f7c32c 100644
--- a/packages/abc/se/se-container.component.ts
+++ b/packages/abc/se/se-container.component.ts
@@ -26,7 +26,7 @@ import { SEErrorRefresh, SELayout } from './se.types';
{{ title }}
-
+
`,
host: {
'[class.ant-row]': `true`,
@@ -119,7 +119,7 @@ export class SEContainerComponent {
@Component({
selector: 'se-title, [se-title]',
exportAs: 'seTitle',
- template: '',
+ template: '',
host: {
'[class.se__title]': 'true'
},
diff --git a/packages/abc/se/se.component.html b/packages/abc/se/se.component.html
index 1bb83ebedf..78aa42f63b 100644
--- a/packages/abc/se/se.component.html
+++ b/packages/abc/se/se.component.html
@@ -24,7 +24,7 @@
-
+
diff --git a/src/app/shared/components/code-box/code-box.component.html b/src/app/shared/components/code-box/code-box.component.html
index df88c14a37..9860d5fd52 100644
--- a/src/app/shared/components/code-box/code-box.component.html
+++ b/src/app/shared/components/code-box/code-box.component.html
@@ -1,7 +1,7 @@
@@ -9,7 +9,7 @@
{{ item.title }}
-
+
diff --git a/src/app/shared/components/content/content.component.html b/src/app/shared/components/content/content.component.html
index bc92ba5714..ed0712ddb7 100644
--- a/src/app/shared/components/content/content.component.html
+++ b/src/app/shared/components/content/content.component.html
@@ -6,7 +6,7 @@
@@ -28,7 +28,7 @@
diff --git a/src/app/shared/components/docs/docs.component.html b/src/app/shared/components/docs/docs.component.html
index aa1a1cd152..df9eb6cd9b 100644
--- a/src/app/shared/components/docs/docs.component.html
+++ b/src/app/shared/components/docs/docs.component.html
@@ -2,7 +2,7 @@
0">
-
+
@@ -38,13 +38,13 @@
IMPORT MODULE
-
+
-
+
diff --git a/src/app/shared/components/footer/footer.component.html b/src/app/shared/components/footer/footer.component.html
index a8420e45bb..5aa8e74ca5 100644
--- a/src/app/shared/components/footer/footer.component.html
+++ b/src/app/shared/components/footer/footer.component.html
@@ -76,7 +76,7 @@ {{ 'app.footer.community' | i18n }}
-
+
diff --git a/src/dev/home/home.component.ts b/src/dev/home/home.component.ts
index b6440b31c4..e074c5d6c4 100644
--- a/src/dev/home/home.component.ts
+++ b/src/dev/home/home.component.ts
@@ -5,7 +5,7 @@ import { LayoutDefaultService } from '@delon/theme/layout-default';
@Component({
selector: 'dev-home',
template: `
-
+
home
options: {{ srv.options | json }}
diff --git a/src/dev/layout.component.ts b/src/dev/layout.component.ts
index 6afe312eeb..9b9d1a522c 100644
--- a/src/dev/layout.component.ts
+++ b/src/dev/layout.component.ts
@@ -79,7 +79,7 @@ const ICONS = [
-
+
{{ user.name }}
{{ user.email }}
@@ -92,10 +92,10 @@ const ICONS = [
-
-
+
+
-
+
`,
host: {
'[class.alain-default]': 'true'
diff --git a/src/dev/lazy/layout.component.ts b/src/dev/lazy/layout.component.ts
index db01ac9bfa..7fca67e7c8 100644
--- a/src/dev/lazy/layout.component.ts
+++ b/src/dev/lazy/layout.component.ts
@@ -5,10 +5,10 @@ import { format } from 'date-fns';
@Component({
selector: 'dev-lazy-layout',
template: `
-
+
Lazy Module, {{ now | json }}
-
+
`
})
diff --git a/src/dev/list/layout.component.ts b/src/dev/list/layout.component.ts
index 00cc710864..bcbf68b06f 100644
--- a/src/dev/list/layout.component.ts
+++ b/src/dev/list/layout.component.ts
@@ -6,12 +6,12 @@ import { format } from 'date-fns';
@Component({
selector: 'dev-list-layout',
template: `
-
+
Layout
first: {{ first | json }},now: {{ now | json }}
-
+
`
})
diff --git a/src/dev/pages/page.component.ts b/src/dev/pages/page.component.ts
index 6794287a57..2c99bae464 100644
--- a/src/dev/pages/page.component.ts
+++ b/src/dev/pages/page.component.ts
@@ -6,7 +6,7 @@ import { format } from 'date-fns';
@Component({
selector: 'dev-page',
template: `
-
+
first: {{ first | json }},now: {{ now | json }}
id: {{ id | json }}
page: {{ route.url | json }}