Refactor: DataProviderService
This commit is contained in:
@@ -1,18 +1,25 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
import { Keymap } from '../config-serializer/config-items/Keymap';
|
||||||
|
import { UhkConfiguration } from '../config-serializer/config-items/UhkConfiguration';
|
||||||
|
|
||||||
import { SvgModule } from '../components/svg/module/svg-module.model';
|
import { SvgModule } from '../components/svg/module/svg-module.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DataProviderService {
|
export class DataProviderService {
|
||||||
|
|
||||||
constructor() { }
|
private uhkConfiguration: UhkConfiguration;
|
||||||
|
|
||||||
getUHKConfig(): any {
|
constructor() {
|
||||||
return require('json!../config-serializer/uhk-config.json');
|
this.uhkConfiguration = new UhkConfiguration().fromJsObject(require('json!../config-serializer/uhk-config.json'));
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefaultKeymaps(): any {
|
getUHKConfig(): UhkConfiguration {
|
||||||
return require('json!../config-serializer/preset-keymaps.json');
|
return this.uhkConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
getDefaultKeymaps(): Keymap[] {
|
||||||
|
return (<any[]>require('json!../config-serializer/preset-keymaps.json')).map(keymap => new Keymap().fromJsObject(keymap));
|
||||||
}
|
}
|
||||||
|
|
||||||
getKeyboardSvgAttributes(): { viewBox: string, transform: string, fill: string } {
|
getKeyboardSvgAttributes(): { viewBox: string, transform: string, fill: string } {
|
||||||
|
|||||||
Reference in New Issue
Block a user