Skip to content

Commit c988fd9

Browse files
committed
feat: migrate to standalone components and deprecate NgHttpLoaderModule
1 parent 9045870 commit c988fd9

21 files changed

+38
-22
lines changed

src/lib/components/ng-http-loader.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ import { merge, Observable, partition, timer } from 'rxjs';
1212
import { debounce, distinctUntilChanged, switchMap, tap } from 'rxjs/operators';
1313
import { PendingRequestsInterceptor } from '../services/pending-requests-interceptor.service';
1414
import { SpinnerVisibilityService } from '../services/spinner-visibility.service';
15-
import { Spinkit } from '../spinkits';
15+
import { Spinkit, SPINKIT_COMPONENTS } from '../spinkits';
16+
import { AsyncPipe, NgComponentOutlet, NgIf, NgStyle } from "@angular/common";
1617

1718
@Component({
1819
selector: 'ng-http-loader',
20+
standalone: true,
1921
templateUrl: './ng-http-loader.component.html',
20-
styleUrls: ['./ng-http-loader.component.scss']
22+
styleUrls: ['./ng-http-loader.component.scss'],
23+
imports: [SPINKIT_COMPONENTS, NgStyle, NgComponentOutlet, NgIf, AsyncPipe]
2124
})
2225
export class NgHttpLoaderComponent implements OnInit {
2326

src/lib/components/sk-chasing-dots/sk-chasing-dots.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-chasing-dots',
15+
standalone: true,
1516
templateUrl: './sk-chasing-dots.component.html',
1617
styleUrls: ['./sk-chasing-dots.component.scss']
1718
})

src/lib/components/sk-cube-grid/sk-cube-grid.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-cube-grid',
15+
standalone: true,
1516
templateUrl: './sk-cube-grid.component.html',
1617
styleUrls: ['./sk-cube-grid.component.scss']
1718
})

src/lib/components/sk-double-bounce/sk-double-bounce.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-double-bounce',
15+
standalone: true,
1516
templateUrl: './sk-double-bounce.component.html',
1617
styleUrls: ['./sk-double-bounce.component.scss']
1718
})

src/lib/components/sk-rotating-plane/sk-rotating-plane.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-rotating-plane',
15+
standalone: true,
1516
templateUrl: './sk-rotating-plane.component.html',
1617
styleUrls: ['./sk-rotating-plane.component.scss']
1718
})

src/lib/components/sk-spinner-pulse/sk-spinner-pulse.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-spinner-pulse',
15+
standalone: true,
1516
templateUrl: './sk-spinner-pulse.component.html',
1617
styleUrls: ['./sk-spinner-pulse.component.scss']
1718
})

src/lib/components/sk-three-bounce/sk-three-bounce.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-three-bounce',
15+
standalone: true,
1516
templateUrl: './sk-three-bounce.component.html',
1617
styleUrls: ['./sk-three-bounce.component.scss']
1718
})

src/lib/components/sk-wandering-cubes/sk-wandering-cubes.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-wandering-cubes',
15+
standalone: true,
1516
templateUrl: './sk-wandering-cubes.component.html',
1617
styleUrls: ['./sk-wandering-cubes.component.scss']
1718
})

src/lib/components/sk-wave/sk-wave.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AbstractLoaderDirective } from '../abstract.loader.directive';
1212

1313
@Component({
1414
selector: 'sk-wave',
15+
standalone: true,
1516
templateUrl: './sk-wave.component.html',
1617
styleUrls: ['./sk-wave.component.scss']
1718
})

src/lib/ng-http-loader.module.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,24 @@ import { NgHttpLoaderComponent } from './components/ng-http-loader.component';
1313
import { PendingRequestsInterceptorProvider } from './services/pending-requests-interceptor.service';
1414
import { SPINKIT_COMPONENTS } from './spinkits';
1515

16+
/**
17+
* @deprecated Will be removed in the next release, standalone component will become the default.
18+
*/
1619
@NgModule({
17-
declarations: [
18-
NgHttpLoaderComponent,
19-
...SPINKIT_COMPONENTS,
20-
],
2120
imports: [
2221
CommonModule,
22+
NgHttpLoaderComponent,
23+
...SPINKIT_COMPONENTS,
2324
],
2425
exports: [
2526
NgHttpLoaderComponent,
2627
...SPINKIT_COMPONENTS,
2728
]
2829
})
2930
export class NgHttpLoaderModule {
31+
/**
32+
* @deprecated Will be removed in the next release, standalone component will become the default.
33+
*/
3034
static forRoot(): ModuleWithProviders<NgHttpLoaderModule> {
3135
return {
3236
ngModule: NgHttpLoaderModule,

0 commit comments

Comments
 (0)