MOBILE-2354 workshop: Inject providers and components to compile

main
Dani Palou 2018-06-13 12:35:54 +02:00 committed by Albert Gasset
parent 7a86e1beeb
commit 27c57b01b0
11 changed files with 19 additions and 6 deletions

View File

@ -293,7 +293,8 @@ var templatesSrc = [
'./src/core/**/components/**/*.html',
'./src/core/**/component/**/*.html',
// Only some addon components are injected to compile to decrease load time. Copy only the ones that are needed.
'./src/addon/mod/assign/components/**/*.html'
'./src/addon/mod/assign/components/**/*.html',
'./src/addon/mod/workshop/components/**/*.html'
],
templatesDest = './www/templates';

View File

@ -33,7 +33,7 @@ import { AddonWorkshopAssessmentStrategyDelegate } from '../../providers/assessm
*/
@Component({
selector: 'addon-mod-workshop-assessment-strategy',
templateUrl: 'assessment-strategy.html',
templateUrl: 'addon-mod-workshop-assessment-strategy.html',
})
export class AddonModWorkshopAssessmentStrategyComponent implements OnInit {

View File

@ -25,7 +25,7 @@ import { AddonModWorkshopOfflineProvider } from '../../providers/offline';
*/
@Component({
selector: 'addon-mod-workshop-assessment',
templateUrl: 'assessment.html',
templateUrl: 'addon-mod-workshop-assessment.html',
})
export class AddonModWorkshopAssessmentComponent implements OnInit {
@Input() assessment: any;

View File

@ -27,7 +27,7 @@ import { AddonModWorkshopOfflineProvider } from '../../providers/offline';
*/
@Component({
selector: 'addon-mod-workshop-index',
templateUrl: 'index.html',
templateUrl: 'addon-mod-workshop-index.html',
})
export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivityComponent {
@Input() group = 0;

View File

@ -25,7 +25,7 @@ import { AddonModWorkshopOfflineProvider } from '../../providers/offline';
*/
@Component({
selector: 'addon-mod-workshop-submission',
templateUrl: 'submission.html',
templateUrl: 'addon-mod-workshop-submission.html',
})
export class AddonModWorkshopSubmissionComponent implements OnInit {
@Input() submission: any;

View File

@ -30,6 +30,15 @@ import { AddonModWorkshopPrefetchHandler } from './providers/prefetch-handler';
import { AddonModWorkshopSyncCronHandler } from './providers/sync-cron-handler';
import { CoreUpdateManagerProvider } from '@providers/update-manager';
// List of providers (without handlers).
export const ADDON_MOD_WORKSHOP_PROVIDERS: any[] = [
AddonModWorkshopProvider,
AddonModWorkshopOfflineProvider,
AddonModWorkshopSyncProvider,
AddonModWorkshopHelperProvider,
AddonWorkshopAssessmentStrategyDelegate
];
@NgModule({
declarations: [
],

View File

@ -108,6 +108,7 @@ import { ADDON_MOD_SCORM_PROVIDERS } from '@addon/mod/scorm/scorm.module';
import { ADDON_MOD_SURVEY_PROVIDERS } from '@addon/mod/survey/survey.module';
import { ADDON_MOD_URL_PROVIDERS } from '@addon/mod/url/url.module';
import { ADDON_MOD_WIKI_PROVIDERS } from '@addon/mod/wiki/wiki.module';
import { ADDON_MOD_WORKSHOP_PROVIDERS } from '@addon/mod/workshop/workshop.module';
import { ADDON_NOTES_PROVIDERS } from '@addon/notes/notes.module';
import { ADDON_NOTIFICATIONS_PROVIDERS } from '@addon/notifications/notifications.module';
import { ADDON_PUSHNOTIFICATIONS_PROVIDERS } from '@addon/pushnotifications/pushnotifications.module';
@ -115,6 +116,7 @@ import { ADDON_REMOTETHEMES_PROVIDERS } from '@addon/remotethemes/remotethemes.m
// Import some addon modules that define components, directives and pipes. Only import the important ones.
import { AddonModAssignComponentsModule } from '@addon/mod/assign/components/components.module';
import { AddonModWorkshopComponentsModule } from '@addon/mod/workshop/components/components.module';
/**
* Service to provide functionalities regarding compiling dynamic HTML and Javascript.
@ -136,6 +138,7 @@ export class CoreCompileProvider {
IonicModule, TranslateModule.forChild(), CoreComponentsModule, CoreDirectivesModule, CorePipesModule,
CoreCourseComponentsModule, CoreCoursesComponentsModule, CoreSiteHomeComponentsModule, CoreUserComponentsModule,
CoreCourseDirectivesModule, CoreSitePluginsDirectivesModule, CoreQuestionComponentsModule, AddonModAssignComponentsModule,
AddonModWorkshopComponentsModule
];
constructor(protected injector: Injector, logger: CoreLoggerProvider, compilerFactory: JitCompilerFactory) {
@ -222,7 +225,7 @@ export class CoreCompileProvider {
.concat(ADDON_MOD_LESSON_PROVIDERS).concat(ADDON_MOD_LTI_PROVIDERS).concat(ADDON_MOD_PAGE_PROVIDERS)
.concat(ADDON_MOD_QUIZ_PROVIDERS).concat(ADDON_MOD_RESOURCE_PROVIDERS).concat(ADDON_MOD_SCORM_PROVIDERS)
.concat(ADDON_MOD_SURVEY_PROVIDERS).concat(ADDON_MOD_URL_PROVIDERS).concat(ADDON_MOD_WIKI_PROVIDERS)
.concat(ADDON_NOTES_PROVIDERS).concat(ADDON_NOTIFICATIONS_PROVIDERS)
.concat(ADDON_MOD_WORKSHOP_PROVIDERS).concat(ADDON_NOTES_PROVIDERS).concat(ADDON_NOTIFICATIONS_PROVIDERS)
.concat(ADDON_PUSHNOTIFICATIONS_PROVIDERS).concat(ADDON_REMOTETHEMES_PROVIDERS);
// We cannot inject anything to this constructor. Use the Injector to inject all the providers into the instance.