mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 16:30:13 +01:00
refactor(@core): refactor data services for better integration (#1997)
With this change all components, which used data services before, now use abstract classes of service interfaces, mock services extend interface services, CoreModule contains code to inject a needed implementation of some service.
This commit is contained in:
parent
f17aa32c6d
commit
cac36f0717
67 changed files with 389 additions and 201 deletions
65
src/app/@core/mock/mock-data.module.ts
Normal file
65
src/app/@core/mock/mock-data.module.ts
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { UserService } from './users.service';
|
||||
import { ElectricityService } from './electricity.service';
|
||||
import { SmartTableService } from './smart-table.service';
|
||||
import { UserActivityService } from './user-activity.service';
|
||||
import { OrdersChartService } from './orders-chart.service';
|
||||
import { ProfitChartService } from './profit-chart.service';
|
||||
import { TrafficListService } from './traffic-list.service';
|
||||
import { PeriodsService } from './periods.service';
|
||||
import { EarningService } from './earning.service';
|
||||
import { OrdersProfitChartService } from './orders-profit-chart.service';
|
||||
import { TrafficBarService } from './traffic-bar.service';
|
||||
import { ProfitBarAnimationChartService } from './profit-bar-animation-chart.service';
|
||||
import { TemperatureHumidityService } from './temperature-humidity.service';
|
||||
import { SolarService } from './solar.service';
|
||||
import { TrafficChartService } from './traffic-chart.service';
|
||||
import { StatsBarService } from './stats-bar.service';
|
||||
import { CountryOrderService } from './country-order.service';
|
||||
import { StatsProgressBarService } from './stats-progress-bar.service';
|
||||
import { VisitorsAnalyticsService } from './visitors-analytics.service';
|
||||
import { SecurityCamerasService } from './security-cameras.service';
|
||||
|
||||
const SERVICES = [
|
||||
UserService,
|
||||
ElectricityService,
|
||||
SmartTableService,
|
||||
UserActivityService,
|
||||
OrdersChartService,
|
||||
ProfitChartService,
|
||||
TrafficListService,
|
||||
PeriodsService,
|
||||
EarningService,
|
||||
OrdersProfitChartService,
|
||||
TrafficBarService,
|
||||
ProfitBarAnimationChartService,
|
||||
TemperatureHumidityService,
|
||||
SolarService,
|
||||
TrafficChartService,
|
||||
StatsBarService,
|
||||
CountryOrderService,
|
||||
StatsProgressBarService,
|
||||
VisitorsAnalyticsService,
|
||||
SecurityCamerasService,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
],
|
||||
providers: [
|
||||
...SERVICES,
|
||||
],
|
||||
})
|
||||
export class MockDataModule {
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return <ModuleWithProviders>{
|
||||
ngModule: MockDataModule,
|
||||
providers: [
|
||||
...SERVICES,
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue