Skip to content

Commit

Permalink
exploration-improvements.service.ts from AngularJS to Angular (oppia#…
Browse files Browse the repository at this point in the history
…15051)

* first commit

* service adding

* new line

* test

* reformat

* changed

* something

* update

* update

* comment updated

* comment updated
  • Loading branch information
heyimShivam authored Mar 15, 2022
1 parent 5aa2aa1 commit 5036132
Show file tree
Hide file tree
Showing 6 changed files with 348 additions and 361 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,15 +758,18 @@ export class ExplorationStatesService {
this._refreshGraphEventEmitter.emit();
}

registerOnStateAddedCallback(callback: () => {}): void {
registerOnStateAddedCallback(
callback: (addedStateName: string) => void): void {
this.stateAddedCallbacks.push(callback);
}

registerOnStateDeletedCallback(callback: () => {}): void {
registerOnStateDeletedCallback(
callback: (deletedStateName: string) => void): void {
this.stateDeletedCallbacks.push(callback);
}

registerOnStateRenamedCallback(callback: () => {}): void {
registerOnStateRenamedCallback(
callback: (oldStateName: string, newStateName: string) => void): void {
this.stateRenamedCallbacks.push(callback);
}

Expand All @@ -776,7 +779,8 @@ export class ExplorationStatesService {
this.stateAddedCallbacks.push(callback);
}

registerOnStateInteractionSavedCallback(callback: () => {}): void {
registerOnStateInteractionSavedCallback(
callback: (state: State) => void): void {
this.stateInteractionSavedCallbacks.push(callback);
}

Expand Down
4 changes: 4 additions & 0 deletions core/templates/services/angular-services.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ import { ExplorationStatesService } from 'pages/exploration-editor-page/services
import { GraphDataService } from 'pages/exploration-editor-page/services/graph-data.service';
import { ContributionAndReviewService } from 'pages/contributor-dashboard-page/services/contribution-and-review.service';
import { ContributionAndReviewBackendApiService } from 'pages/contributor-dashboard-page/services/contribution-and-review-backend-api.service';
import { ExplorationImprovementsService } from './exploration-improvements.service';
import { PlaythroughIssuesService } from './playthrough-issues.service';

export const angularServices: [string, Type<{}>][] = [
['AccessValidationBackendApiService', AccessValidationBackendApiService],
Expand Down Expand Up @@ -521,6 +523,7 @@ export const angularServices: [string, Type<{}>][] = [
ExplorationImprovementsBackendApiService],
['ExplorationImprovementsTaskRegistryService',
ExplorationImprovementsTaskRegistryService],
['ExplorationImprovementsService', ExplorationImprovementsService],
['ExplorationInitStateNameService', ExplorationInitStateNameService],
['ExplorationLanguageCodeService', ExplorationLanguageCodeService],
['ExplorationObjectiveService', ExplorationObjectiveService],
Expand Down Expand Up @@ -659,6 +662,7 @@ export const angularServices: [string, Type<{}>][] = [
['PlatformFeatureDummyBackendApiService',
PlatformFeatureDummyBackendApiService],
['PlatformFeatureService', PlatformFeatureService],
['PlaythroughIssuesService', PlaythroughIssuesService],
['PlayerCorrectnessFeedbackEnabledService',
PlayerCorrectnessFeedbackEnabledService],
['PlayerPositionService', PlayerPositionService],
Expand Down
Loading

0 comments on commit 5036132

Please sign in to comment.