Skip to content

Commit ef18ea9

Browse files
update: proxies to use injection function instead
1 parent 0d82f26 commit ef18ea9

File tree

10 files changed

+1329
-980
lines changed

10 files changed

+1329
-980
lines changed

TodoApp-SingleLayer/Angular-EfCore/angular/src/app/app.config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import { provideRouter } from '@angular/router';
1010
import { environment } from '../environments/environment';
1111
import { APP_ROUTES } from './app.routes';
1212
import { APP_ROUTE_PROVIDER } from './route.provider';
13-
import {registerLocale} from '@abp/ng.core/locale';
14-
import {provideThemeLeptonX} from "@abp/ng.theme.lepton-x";
15-
import {provideTenantManagementConfig} from "@abp/ng.tenant-management/config";
16-
import {provideIdentityConfig} from "@abp/ng.identity/config";
17-
import {provideAccountConfig} from "@abp/ng.account/config";
18-
import {provideSideMenuLayout} from "@abp/ng.theme.lepton-x/layouts";
13+
import { registerLocaleForEsBuild } from '@abp/ng.core/locale';
14+
import { provideThemeLeptonX } from '@abp/ng.theme.lepton-x';
15+
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
16+
import { provideIdentityConfig } from '@abp/ng.identity/config';
17+
import { provideAccountConfig } from '@abp/ng.account/config';
18+
import { provideSideMenuLayout } from '@abp/ng.theme.lepton-x/layouts';
1919

2020
export const appConfig: ApplicationConfig = {
2121
providers: [
@@ -25,8 +25,8 @@ export const appConfig: ApplicationConfig = {
2525
provideAbpCore(
2626
withOptions({
2727
environment,
28-
registerLocaleFn: registerLocale(),
29-
}),
28+
registerLocaleFn: registerLocaleForEsBuild(),
29+
})
3030
),
3131
provideAbpOAuth(),
3232
provideSettingManagementConfig(),
@@ -37,6 +37,6 @@ export const appConfig: ApplicationConfig = {
3737
provideTenantManagementConfig(),
3838
provideIdentityConfig(),
3939
provideAccountConfig(),
40-
provideLogo(withEnvironmentOptions(environment))
41-
]
40+
provideLogo(withEnvironmentOptions(environment)),
41+
],
4242
};
Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { TodoItemDto } from './dtos/models';
22
import { RestService } from '@abp/ng.core';
3-
import { Injectable } from '@angular/core';
3+
import { inject, Injectable } from '@angular/core';
44

55
@Injectable({
66
providedIn: 'root',
@@ -9,26 +9,32 @@ export class TodoService {
99
apiName = 'Default';
1010

1111
create = (text: string) =>
12-
this.restService.request<any, TodoItemDto>({
13-
method: 'POST',
14-
url: '/api/app/todo',
15-
params: { text },
16-
},
17-
{ apiName: this.apiName });
12+
this.restService.request<any, TodoItemDto>(
13+
{
14+
method: 'POST',
15+
url: '/api/app/todo',
16+
params: { text },
17+
},
18+
{ apiName: this.apiName }
19+
);
1820

1921
delete = (id: string) =>
20-
this.restService.request<any, void>({
21-
method: 'DELETE',
22-
url: `/api/app/todo/${id}`,
23-
},
24-
{ apiName: this.apiName });
22+
this.restService.request<any, void>(
23+
{
24+
method: 'DELETE',
25+
url: `/api/app/todo/${id}`,
26+
},
27+
{ apiName: this.apiName }
28+
);
2529

2630
getList = () =>
27-
this.restService.request<any, TodoItemDto[]>({
28-
method: 'GET',
29-
url: '/api/app/todo',
30-
},
31-
{ apiName: this.apiName });
31+
this.restService.request<any, TodoItemDto[]>(
32+
{
33+
method: 'GET',
34+
url: '/api/app/todo',
35+
},
36+
{ apiName: this.apiName }
37+
);
3238

33-
constructor(private restService: RestService) {}
39+
private restService = inject(RestService);
3440
}

TodoApp-SingleLayer/Angular-EfCore/angular/yarn.lock

Lines changed: 596 additions & 432 deletions
Large diffs are not rendered by default.

TodoApp-SingleLayer/Angular-Mongo/angular/src/app/app.config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import { provideRouter } from '@angular/router';
1010
import { environment } from '../environments/environment';
1111
import { APP_ROUTES } from './app.routes';
1212
import { APP_ROUTE_PROVIDER } from './route.provider';
13-
import {registerLocale} from '@abp/ng.core/locale';
14-
import {provideThemeLeptonX} from "@abp/ng.theme.lepton-x";
15-
import {provideTenantManagementConfig} from "@abp/ng.tenant-management/config";
16-
import {provideIdentityConfig} from "@abp/ng.identity/config";
17-
import {provideAccountConfig} from "@abp/ng.account/config";
18-
import {provideSideMenuLayout} from "@abp/ng.theme.lepton-x/layouts";
13+
import { registerLocaleForEsBuild } from '@abp/ng.core/locale';
14+
import { provideThemeLeptonX } from '@abp/ng.theme.lepton-x';
15+
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
16+
import { provideIdentityConfig } from '@abp/ng.identity/config';
17+
import { provideAccountConfig } from '@abp/ng.account/config';
18+
import { provideSideMenuLayout } from '@abp/ng.theme.lepton-x/layouts';
1919

2020
export const appConfig: ApplicationConfig = {
2121
providers: [
@@ -25,8 +25,8 @@ export const appConfig: ApplicationConfig = {
2525
provideAbpCore(
2626
withOptions({
2727
environment,
28-
registerLocaleFn: registerLocale(),
29-
}),
28+
registerLocaleFn: registerLocaleForEsBuild(),
29+
})
3030
),
3131
provideAbpOAuth(),
3232
provideSettingManagementConfig(),
@@ -37,6 +37,6 @@ export const appConfig: ApplicationConfig = {
3737
provideTenantManagementConfig(),
3838
provideIdentityConfig(),
3939
provideAccountConfig(),
40-
provideLogo(withEnvironmentOptions(environment))
41-
]
40+
provideLogo(withEnvironmentOptions(environment)),
41+
],
4242
};
Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { TodoItemDto } from './dtos/models';
22
import { RestService } from '@abp/ng.core';
3-
import { Injectable } from '@angular/core';
3+
import { inject, Injectable } from '@angular/core';
44

55
@Injectable({
66
providedIn: 'root',
@@ -9,26 +9,32 @@ export class TodoService {
99
apiName = 'Default';
1010

1111
create = (text: string) =>
12-
this.restService.request<any, TodoItemDto>({
13-
method: 'POST',
14-
url: '/api/app/todo',
15-
params: { text },
16-
},
17-
{ apiName: this.apiName });
12+
this.restService.request<any, TodoItemDto>(
13+
{
14+
method: 'POST',
15+
url: '/api/app/todo',
16+
params: { text },
17+
},
18+
{ apiName: this.apiName }
19+
);
1820

1921
delete = (id: string) =>
20-
this.restService.request<any, void>({
21-
method: 'DELETE',
22-
url: `/api/app/todo/${id}`,
23-
},
24-
{ apiName: this.apiName });
22+
this.restService.request<any, void>(
23+
{
24+
method: 'DELETE',
25+
url: `/api/app/todo/${id}`,
26+
},
27+
{ apiName: this.apiName }
28+
);
2529

2630
getList = () =>
27-
this.restService.request<any, TodoItemDto[]>({
28-
method: 'GET',
29-
url: '/api/app/todo',
30-
},
31-
{ apiName: this.apiName });
31+
this.restService.request<any, TodoItemDto[]>(
32+
{
33+
method: 'GET',
34+
url: '/api/app/todo',
35+
},
36+
{ apiName: this.apiName }
37+
);
3238

33-
constructor(private restService: RestService) {}
39+
private restService = inject(RestService);
3440
}

TodoApp/Angular-EfCore/angular/src/app/app.config.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import { provideAbpOAuth } from '@abp/ng.oauth';
33
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
44
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
55
import { provideAbpThemeShared } from '@abp/ng.theme.shared';
6-
import { provideLogo, withEnvironmentOptions } from "@volo/ngx-lepton-x.core";
6+
import { provideLogo, withEnvironmentOptions } from '@volo/ngx-lepton-x.core';
77
import { ApplicationConfig } from '@angular/core';
88
import { provideAnimations } from '@angular/platform-browser/animations';
99
import { provideRouter } from '@angular/router';
1010
import { environment } from '../environments/environment';
1111
import { APP_ROUTES } from './app.routes';
1212
import { APP_ROUTE_PROVIDER } from './route.provider';
13-
import {registerLocale} from "@abp/ng.core/locale";
14-
import {provideThemeLeptonX} from "@abp/ng.theme.lepton-x";
15-
import {provideTenantManagementConfig} from "@abp/ng.tenant-management/config";
16-
import {provideIdentityConfig} from "@abp/ng.identity/config";
17-
import {provideAccountConfig} from "@abp/ng.account/config";
18-
import {provideSideMenuLayout} from "@abp/ng.theme.lepton-x/layouts";
13+
import { registerLocaleForEsBuild } from '@abp/ng.core/locale';
14+
import { provideThemeLeptonX } from '@abp/ng.theme.lepton-x';
15+
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
16+
import { provideIdentityConfig } from '@abp/ng.identity/config';
17+
import { provideAccountConfig } from '@abp/ng.account/config';
18+
import { provideSideMenuLayout } from '@abp/ng.theme.lepton-x/layouts';
1919

2020
export const appConfig: ApplicationConfig = {
2121
providers: [
@@ -25,8 +25,8 @@ export const appConfig: ApplicationConfig = {
2525
provideAbpCore(
2626
withOptions({
2727
environment,
28-
registerLocaleFn: registerLocale(),
29-
}),
28+
registerLocaleFn: registerLocaleForEsBuild(),
29+
})
3030
),
3131
provideAbpOAuth(),
3232
provideSettingManagementConfig(),
@@ -37,6 +37,6 @@ export const appConfig: ApplicationConfig = {
3737
provideTenantManagementConfig(),
3838
provideIdentityConfig(),
3939
provideAccountConfig(),
40-
provideLogo(withEnvironmentOptions(environment))
41-
]
40+
provideLogo(withEnvironmentOptions(environment)),
41+
],
4242
};
Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
import type { TodoItemDto } from './models';
22
import { RestService } from '@abp/ng.core';
3-
import { Injectable } from '@angular/core';
3+
import { inject, Injectable } from '@angular/core';
44

55
@Injectable({
66
providedIn: 'root',
77
})
88
export class TodoService {
99
apiName = 'Default';
10-
1110

1211
create = (text: string) =>
13-
this.restService.request<any, TodoItemDto>({
14-
method: 'POST',
15-
url: '/api/app/todo',
16-
params: { text },
17-
},
18-
{ apiName: this.apiName });
19-
12+
this.restService.request<any, TodoItemDto>(
13+
{
14+
method: 'POST',
15+
url: '/api/app/todo',
16+
params: { text },
17+
},
18+
{ apiName: this.apiName }
19+
);
2020

2121
delete = (id: string) =>
22-
this.restService.request<any, void>({
23-
method: 'DELETE',
24-
url: `/api/app/todo/${id}`,
25-
},
26-
{ apiName: this.apiName });
27-
22+
this.restService.request<any, void>(
23+
{
24+
method: 'DELETE',
25+
url: `/api/app/todo/${id}`,
26+
},
27+
{ apiName: this.apiName }
28+
);
2829

2930
getList = () =>
30-
this.restService.request<any, TodoItemDto[]>({
31-
method: 'GET',
32-
url: '/api/app/todo',
33-
},
34-
{ apiName: this.apiName });
31+
this.restService.request<any, TodoItemDto[]>(
32+
{
33+
method: 'GET',
34+
url: '/api/app/todo',
35+
},
36+
{ apiName: this.apiName }
37+
);
3538

36-
constructor(private restService: RestService) {}
39+
private restService = inject(RestService);
3740
}

0 commit comments

Comments
 (0)