Skip to content

Commit 328e5fb

Browse files
committed
refactor(docs-callout): use control flow
1 parent e92aefb commit 328e5fb

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

Diff for: src/components/docs-callout/docs-callout.component.html

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<c-callout class="bg-white:dark:bg-transparent" color="info">
2-
<ng-container *ngTemplateOutlet="default"></ng-container>
2+
<ng-container *ngTemplateOutlet="default" />
33
</c-callout>
44

55
<ng-template #default>
6-
<p *ngIf="!!name">
7-
An Angular {{name}} component{{plural ? 's' : ''}} {{plural ? 'have' : 'has'}} been created as a native Angular
8-
version
9-
of Bootstrap {{name}}. {{name}} {{plural ? 'are' : 'is'}} delivered with some new features,
10-
variants, and unique design that matches CoreUI Design System requirements.
11-
</p>
6+
@if (!!name) {
7+
<p>
8+
An Angular {{ name }} component{{ plural ? 's' : '' }} {{ plural ? 'have' : 'has' }} been created as a native
9+
Angular
10+
version
11+
of Bootstrap {{ name }}. {{ name }} {{ plural ? 'are' : 'is' }} delivered with some new features,
12+
variants, and unique design that matches CoreUI Design System requirements.
13+
</p>
14+
}
1215

13-
<ng-content></ng-content>
16+
<ng-content />
1417

1518
<br>
1619
For more information please visit our official <a href="{{href}}" target="_blank">documentation of CoreUI Components Library for Angular.</a>

Diff for: src/components/docs-callout/docs-callout.component.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { Component, Input } from '@angular/core';
22
import packageJson from '../../../package.json';
3-
import { NgTemplateOutlet, NgIf } from '@angular/common';
3+
import { NgTemplateOutlet } from '@angular/common';
44
import { CalloutComponent } from '@coreui/angular';
55

66
@Component({
7-
selector: 'app-docs-callout',
8-
templateUrl: './docs-callout.component.html',
9-
styleUrls: ['./docs-callout.component.scss'],
10-
standalone: true,
11-
imports: [CalloutComponent, NgTemplateOutlet, NgIf]
7+
selector: 'app-docs-callout',
8+
templateUrl: './docs-callout.component.html',
9+
styleUrls: ['./docs-callout.component.scss'],
10+
standalone: true,
11+
imports: [CalloutComponent, NgTemplateOutlet]
1212
})
1313
export class DocsCalloutComponent {
1414

0 commit comments

Comments
 (0)