Skip to content

Commit 15371ec

Browse files
committed
create skeleton component
1 parent 59484d0 commit 15371ec

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {
2+
ChangeDetectionStrategy,
3+
Component,
4+
Input,
5+
ViewEncapsulation,
6+
} from '@angular/core';
7+
8+
@Component({
9+
selector: 'skeleton',
10+
template: `
11+
<div class="animate-pulse" [ngClass]="styleClass">
12+
<ng-content></ng-content>
13+
</div>
14+
`,
15+
changeDetection: ChangeDetectionStrategy.OnPush,
16+
encapsulation: ViewEncapsulation.None,
17+
})
18+
export class SkeletonComponent {
19+
@Input() styleClass!: string;
20+
}

src/app/shared/components/skeletons/skeleton.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33

44
import { BackdropLoaderComponent } from './backdrop-loader.component';
5+
import { SkeletonComponent } from './skeleton.component';
56

6-
const COMPONENTS = [BackdropLoaderComponent];
7+
const COMPONENTS = [BackdropLoaderComponent, SkeletonComponent];
78

89
@NgModule({
910
declarations: COMPONENTS,

0 commit comments

Comments
 (0)