MOBILE-2333 core: Export lists of providers

main
Dani Palou 2018-02-13 14:38:04 +01:00
parent 7d3162585c
commit 91c8be2167
13 changed files with 139 additions and 77 deletions

View File

@ -81,6 +81,36 @@ export function createTranslateLoader(http: HttpClient): TranslateHttpLoader {
return new TranslateHttpLoader(http, './assets/lang/', '.json');
}
// List of providers.
export const CORE_PROVIDERS: any[] = [
CoreLoggerProvider,
CoreDbProvider,
CoreAppProvider,
CoreConfigProvider,
CoreLangProvider,
CoreTextUtilsProvider,
CoreDomUtilsProvider,
CoreTimeUtilsProvider,
CoreUrlUtilsProvider,
CoreUtilsProvider,
CoreMimetypeUtilsProvider,
CoreInitDelegate,
CoreFileProvider,
CoreWSProvider,
CoreEventsProvider,
CoreSitesFactoryProvider,
CoreSitesProvider,
CoreLocalNotificationsProvider,
CoreGroupsProvider,
CoreCronDelegate,
CoreFileSessionProvider,
CoreFilepoolProvider,
CoreUpdateManagerProvider,
CorePluginFileDelegate,
CoreSyncProvider,
CoreAddonManagerProvider
];
@NgModule({
declarations: [
MoodleMobileApp
@ -126,39 +156,13 @@ export function createTranslateLoader(http: HttpClient): TranslateHttpLoader {
entryComponents: [
MoodleMobileApp
],
providers: [
providers: CORE_PROVIDERS.concat([
{
provide: HTTP_INTERCEPTORS,
useClass: CoreInterceptor,
multi: true,
},
CoreLoggerProvider,
CoreDbProvider,
CoreAppProvider,
CoreConfigProvider,
CoreLangProvider,
CoreTextUtilsProvider,
CoreDomUtilsProvider,
CoreTimeUtilsProvider,
CoreUrlUtilsProvider,
CoreUtilsProvider,
CoreMimetypeUtilsProvider,
CoreInitDelegate,
CoreFileProvider,
CoreWSProvider,
CoreEventsProvider,
CoreSitesFactoryProvider,
CoreSitesProvider,
CoreLocalNotificationsProvider,
CoreGroupsProvider,
CoreCronDelegate,
CoreFileSessionProvider,
CoreFilepoolProvider,
CoreUpdateManagerProvider,
CorePluginFileDelegate,
CoreSyncProvider,
CoreAddonManagerProvider
]
}
])
})
export class AppModule {
constructor(platform: Platform, initDelegate: CoreInitDelegate, updateManager: CoreUpdateManagerProvider,

View File

@ -16,14 +16,17 @@ import { NgModule } from '@angular/core';
import { CoreContentLinksDelegate } from './providers/delegate';
import { CoreContentLinksHelperProvider } from './providers/helper';
// List of providers.
export const CORE_CONTENTLINKS_PROVIDERS = [
CoreContentLinksDelegate,
CoreContentLinksHelperProvider
];
@NgModule({
declarations: [],
imports: [
],
providers: [
CoreContentLinksDelegate,
CoreContentLinksHelperProvider
],
providers: CORE_CONTENTLINKS_PROVIDERS,
exports: []
})
export class CoreContentLinksModule {}

View File

@ -25,6 +25,16 @@ import { CoreCourseFormatSocialModule } from './formats/social/social.module';
import { CoreCourseFormatTopicsModule } from './formats/topics/topics.module';
import { CoreCourseFormatWeeksModule } from './formats/weeks/weeks.module';
// List of providers (without handlers).
export const CORE_COURSE_PROVIDERS: any[] = [
CoreCourseProvider,
CoreCourseHelperProvider,
CoreCourseFormatDelegate,
CoreCourseModuleDelegate,
CoreCourseModulePrefetchDelegate,
CoreCourseOptionsDelegate
];
@NgModule({
declarations: [],
imports: [
@ -33,15 +43,9 @@ import { CoreCourseFormatWeeksModule } from './formats/weeks/weeks.module';
CoreCourseFormatWeeksModule,
CoreCourseFormatSocialModule
],
providers: [
CoreCourseProvider,
CoreCourseHelperProvider,
CoreCourseFormatDelegate,
CoreCourseModuleDelegate,
CoreCourseModulePrefetchDelegate,
CoreCourseOptionsDelegate,
providers: CORE_COURSE_PROVIDERS.concat([
CoreCourseFormatDefaultHandler
],
]),
exports: []
})
export class CoreCourseModule {}

View File

@ -22,18 +22,22 @@ import { CoreCoursesMyOverviewLinkHandler } from './providers/my-overview-link-h
import { CoreMainMenuDelegate } from '../mainmenu/providers/delegate';
import { CoreContentLinksDelegate } from '../contentlinks/providers/delegate';
// List of providers (without handlers).
export const CORE_COURSES_PROVIDERS: any[] = [
CoreCoursesProvider,
CoreCoursesMyOverviewProvider
];
@NgModule({
declarations: [],
imports: [
],
providers: [
CoreCoursesProvider,
providers: CORE_COURSES_PROVIDERS.concat([
CoreCoursesMainMenuHandler,
CoreCoursesMyOverviewProvider,
CoreCoursesCourseLinkHandler,
CoreCoursesIndexLinkHandler,
CoreCoursesMyOverviewLinkHandler
],
]),
exports: []
})
export class CoreCoursesModule {

View File

@ -56,6 +56,24 @@ import { CoreUrlUtilsProvider } from '@providers/utils/url';
import { CoreUtilsProvider } from '@providers/utils/utils';
import { CoreInitDelegate } from '@providers/init';
// List of Ionic Native providers.
export const IONIC_NATIVE_PROVIDERS = [
Camera,
Clipboard,
File,
FileTransfer,
Globalization,
InAppBrowser,
Keyboard,
LocalNotifications,
MediaCapture,
Network,
SplashScreen,
StatusBar,
SQLite,
Zip
];
/**
* This module handles the emulation of Cordova plugins in browser and desktop.
*

View File

@ -22,21 +22,25 @@ import { CoreFileUploaderCameraHandler } from './providers/camera-handler';
import { CoreFileUploaderFileHandler } from './providers/file-handler';
import { CoreFileUploaderVideoHandler } from './providers/video-handler';
// List of providers (without handlers).
export const CORE_FILEUPLOADER_PROVIDERS: any[] = [
CoreFileUploaderProvider,
CoreFileUploaderHelperProvider,
CoreFileUploaderDelegate
];
@NgModule({
declarations: [
],
imports: [
],
providers: [
CoreFileUploaderProvider,
CoreFileUploaderHelperProvider,
CoreFileUploaderDelegate,
providers: CORE_FILEUPLOADER_PROVIDERS.concat([
CoreFileUploaderAlbumHandler,
CoreFileUploaderAudioHandler,
CoreFileUploaderCameraHandler,
CoreFileUploaderFileHandler,
CoreFileUploaderVideoHandler
]
])
})
export class CoreFileUploaderModule {
constructor(delegate: CoreFileUploaderDelegate, albumHandler: CoreFileUploaderAlbumHandler,

View File

@ -29,21 +29,25 @@ import { CoreEventsProvider } from '@providers/events';
import { CoreSitesProvider } from '@providers/sites';
import { CoreUserProvider } from '../user/providers/user';
// List of providers (without handlers).
export const CORE_GRADES_PROVIDERS: any[] = [
CoreGradesProvider,
CoreGradesHelperProvider
];
@NgModule({
declarations: [
],
imports: [
CoreGradesComponentsModule
],
providers: [
CoreGradesProvider,
CoreGradesHelperProvider,
providers: CORE_GRADES_PROVIDERS.concat([
CoreGradesMainMenuHandler,
CoreGradesCourseOptionHandler,
CoreGradesUserLinkHandler,
CoreGradesOverviewLinkHandler,
CoreGradesUserHandler
]
])
})
export class CoreGradesModule {
constructor(mainMenuDelegate: CoreMainMenuDelegate, gradesMenuHandler: CoreGradesMainMenuHandler,

View File

@ -15,13 +15,16 @@
import { NgModule } from '@angular/core';
import { CoreLoginHelperProvider } from './providers/helper';
// List of providers.
export const CORE_LOGIN_PROVIDERS = [
CoreLoginHelperProvider
];
@NgModule({
declarations: [
],
imports: [
],
providers: [
CoreLoginHelperProvider
]
providers: CORE_LOGIN_PROVIDERS
})
export class CoreLoginModule {}

View File

@ -16,14 +16,17 @@ import { NgModule } from '@angular/core';
import { CoreMainMenuDelegate } from './providers/delegate';
import { CoreMainMenuProvider } from './providers/mainmenu';
// List of providers.
export const CORE_MAINMENU_PROVIDERS = [
CoreMainMenuDelegate,
CoreMainMenuProvider
];
@NgModule({
declarations: [
],
imports: [
],
providers: [
CoreMainMenuDelegate,
CoreMainMenuProvider
]
providers: CORE_MAINMENU_PROVIDERS
})
export class CoreMainMenuModule {}

View File

@ -19,16 +19,20 @@ import { CoreSharedFilesHelperProvider } from './providers/helper';
import { CoreSharedFilesUploadHandler } from './providers/upload-handler';
import { CoreFileUploaderDelegate } from '../fileuploader/providers/delegate';
// List of providers (without handlers).
export const CORE_SHAREDFILES_PROVIDERS: any[] = [
CoreSharedFilesProvider,
CoreSharedFilesHelperProvider
];
@NgModule({
declarations: [
],
imports: [
],
providers: [
CoreSharedFilesProvider,
CoreSharedFilesHelperProvider,
providers: CORE_SHAREDFILES_PROVIDERS.concat([
CoreSharedFilesUploadHandler
]
])
})
export class CoreSharedFilesModule {
constructor(platform: Platform, delegate: CoreFileUploaderDelegate, handler: CoreSharedFilesUploadHandler,

View File

@ -16,13 +16,16 @@ import { NgModule } from '@angular/core';
import { Platform } from 'ionic-angular';
import { CoreSiteAddonsProvider } from './providers/siteaddons';
// List of providers.
export const CORE_SITEADDONS_PROVIDERS = [
CoreSiteAddonsProvider
];
@NgModule({
declarations: [
],
imports: [
],
providers: [
CoreSiteAddonsProvider
]
providers: CORE_SITEADDONS_PROVIDERS
})
export class CoreSiteAddonsModule { }

View File

@ -19,15 +19,19 @@ import { CoreSiteHomeIndexLinkHandler } from './providers/index-link-handler';
import { CoreMainMenuDelegate } from '../mainmenu/providers/delegate';
import { CoreContentLinksDelegate } from '../contentlinks/providers/delegate';
// List of providers (without handlers).
export const CORE_SITEHOME_PROVIDERS: any[] = [
CoreSiteHomeProvider
];
@NgModule({
declarations: [],
imports: [
],
providers: [
CoreSiteHomeProvider,
providers: CORE_SITEHOME_PROVIDERS.concat([
CoreSiteHomeMainMenuHandler,
CoreSiteHomeIndexLinkHandler
],
]),
exports: []
})
export class CoreSiteHomeModule {

View File

@ -27,22 +27,26 @@ import { CoreUserParticipantsLinkHandler } from './providers/participants-link-h
import { CoreCourseOptionsDelegate } from '@core/course/providers/options-delegate';
import { CoreUserComponentsModule } from './components/components.module';
// List of providers (without handlers).
export const CORE_USER_PROVIDERS: any[] = [
CoreUserDelegate,
CoreUserProfileFieldDelegate,
CoreUserProvider,
CoreUserHelperProvider,
];
@NgModule({
declarations: [
],
imports: [
CoreUserComponentsModule
],
providers: [
CoreUserDelegate,
CoreUserProfileFieldDelegate,
providers: CORE_USER_PROVIDERS.concat([
CoreUserProfileMailHandler,
CoreUserProvider,
CoreUserHelperProvider,
CoreUserProfileLinkHandler,
CoreUserParticipantsCourseOptionHandler,
CoreUserParticipantsLinkHandler
]
])
})
export class CoreUserModule {
constructor(userDelegate: CoreUserDelegate, userProfileMailHandler: CoreUserProfileMailHandler,