Skip to content

Commit e74b2b0

Browse files
committed
Migrate to signal inputs
Breaking change remove CgBusyModule use instead provider BUSY_OPTIONS rename components and service files to match angular styleguide fix eslint config file update dependencies update github actions dependencies update copyright year
1 parent aa9e98d commit e74b2b0

24 files changed

+2516
-3719
lines changed

.github/workflows/deploy-demo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
10-
- uses: actions/setup-node@v4
9+
- uses: actions/checkout@v6
10+
- uses: actions/setup-node@v6
1111
with:
12-
node-version: '22'
12+
node-version: '24'
1313
registry-url: 'https://registry.npmjs.org'
1414
- name: npm install, build, and deploy
1515
run: |

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
publish:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1717

18-
- uses: actions/setup-node@v4
18+
- uses: actions/setup-node@v6
1919
with:
20-
node-version: '22'
20+
node-version: '24'
2121
registry-url: 'https://registry.npmjs.org'
2222

2323
# Ensure npm 11.5.1 or later is installed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Tiberiu Zuld
3+
Copyright (c) 2026 Tiberiu Zuld
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,51 +17,14 @@ Install with npm.
1717
npm install angular-busy2 --save
1818
```
1919

20-
Add `CgBusyModule` as a module dependency for your module.
21-
22-
You have to import it with `forRoot` in any module where you want to provide `CgBusyDefaults`.
23-
24-
Usually you do that in your root module (`app.module`).
25-
26-
If you never import it with `forRoot` `CgBusyDefaults` will always be `undefined`.
27-
28-
`forRoot` takes optional `CgBusyOptions` as parameter.
29-
30-
For every omitted option in the supplied `CgBusyOptions` the libraries default value will be used.
31-
32-
```typescript
33-
import { CgBusyModule } from 'angular-busy2';
34-
35-
@NgModule({
36-
imports: [
37-
CgBusyModule.forRoot({
38-
backdrop: true
39-
}) //import it with .forRoot in your root module. provide some optional Options.
40-
]
41-
})
42-
```
43-
44-
In every shared module/sub module you should import `CgBusyModule` without `forRoot` unless you want to provide a
45-
different instance of `CgBusyDefaults`
46-
47-
### Standalone import directive
20+
## Standalone import directive
4821

4922
```typescript
5023
import { CgBusyDirective } from 'angular-busy2';
5124

5225
@Component({
53-
standalone: true,
54-
imports: [CgBusyDirective],
55-
// ...
26+
imports: [CgBusyDirective]
5627
})
57-
58-
// main.ts if you bootstrap application
59-
bootstrapApplication(AppComponent, {
60-
providers: [
61-
importProvidersFrom(CgBusyModule.forRoot())
62-
// ...
63-
]
64-
}).catch(err => console.log(err));
6528
```
6629

6730
## Options
@@ -98,24 +61,41 @@ or this:
9861
sign/animation. Defaults to `undefined`. Typically only useful if you wish to apply different positioning to the
9962
animation.
10063

101-
## Overriding Defaults
64+
## Overriding Defaults options via BUSY_OPTIONS
65+
For every omitted option in the supplied `CgBusyOptions` the libraries default value will be used.
66+
67+
```typescript
68+
import { BUSY_OPTIONS, CgBusyOptions } from 'angular-busy2';
69+
70+
export const appConfig: ApplicationConfig = {
71+
providers: [
72+
{
73+
provide: BUSY_OPTIONS,
74+
useValue: {
75+
minDuration: 100
76+
} as CgBusyOptions
77+
}
78+
]
79+
};
80+
```
81+
82+
## Overriding Defaults via service
10283

10384
The default values for `message`, `backdrop`, `templateRef`, `delay`, and `minDuration` may all be overridden by
10485
overriding the `CgBusyDefaults`, like so:
10586

10687
```typescript
10788
import { CgBusyDefaults } from 'angular-busy2';
10889

109-
class AppComponent {
110-
@ViewChild('customTemplate')
111-
private customTemplateTpl: TemplateRef<any>;
90+
class App {
91+
private customTemplateTpl: TemplateRef<any> = viewChild.required('customTemplate');
11292

11393
constructor(private busyDefaults: CgBusyDefaults) {
11494
this.busyDefaults.delay = 5000;
11595
}
11696

11797
ngOnInit() {
118-
this.busyDefaults.templateRef = this.customTemplateTpl;
98+
this.busyDefaults.templateRef = this.customTemplateTpl();
11999
}
120100
}
121101
```
File renamed without changes.

0 commit comments

Comments
 (0)