Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1093 from azavea/feature/preload-static-config
Browse files Browse the repository at this point in the history
Preload indicator chart static config
  • Loading branch information
rmartz authored Apr 6, 2018
2 parents 3cce626 + 9223c66 commit 16143c1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Preload static indicator chart configuration data on app load

## [1.0.0] - 2018-04-03
- MVP Release
### Added
Expand Down
24 changes: 22 additions & 2 deletions src/angular/planit/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule, Routes } from '@angular/router';

import { ApiModule, ChartsModule } from 'climate-change-components';
import {
ApiModule,
ChartsModule,
ClimateModelService,
DatasetService,
ScenarioService
} from 'climate-change-components';

import { ToastrModule } from 'ngx-toastr';

Expand Down Expand Up @@ -180,4 +186,18 @@ import { ResetPasswordComponent } from './reset-password/reset-password.componen
],
bootstrap: [AppComponent]
})
export class AppModule { }
export class AppModule {
constructor (private userService: UserService,
private datasetService: DatasetService,
private scenarioService: ScenarioService,
private modelService: ClimateModelService) {
this.userService.currentUser.first().subscribe(() => {
// Issue an eager request for indicator static configuration data so it's already cached if
// the user opens an indicator chart
this.datasetService.list().subscribe();
this.scenarioService.list().subscribe();
this.modelService.list().subscribe();
});

}
}

0 comments on commit 16143c1

Please sign in to comment.