mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#1370 Remove use of AlfrescoSettingsService
This commit is contained in:
@@ -21,7 +21,7 @@ import { Router } from '@angular/router';
|
||||
import {
|
||||
AlfrescoTranslationService,
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoSettingsService,
|
||||
SettingsService,
|
||||
StorageService
|
||||
} from 'ng2-alfresco-core';
|
||||
|
||||
@@ -40,7 +40,7 @@ export class AppComponent {
|
||||
|
||||
constructor(public auth: AlfrescoAuthenticationService,
|
||||
public router: Router,
|
||||
public alfrescoSettingsService: AlfrescoSettingsService,
|
||||
public settingsService: SettingsService,
|
||||
private translate: AlfrescoTranslationService,
|
||||
private storage: StorageService) {
|
||||
this.setEcmHost();
|
||||
@@ -118,25 +118,25 @@ export class AppComponent {
|
||||
|
||||
private setEcmHost() {
|
||||
if (this.storage.hasItem(`ecmHost`)) {
|
||||
this.alfrescoSettingsService.ecmHost = this.storage.getItem(`ecmHost`);
|
||||
this.settingsService.ecmHost = this.storage.getItem(`ecmHost`);
|
||||
this.ecmHost = this.storage.getItem(`ecmHost`);
|
||||
} else {
|
||||
this.alfrescoSettingsService.ecmHost = this.ecmHost;
|
||||
this.settingsService.ecmHost = this.ecmHost;
|
||||
}
|
||||
}
|
||||
|
||||
private setBpmHost() {
|
||||
if (this.storage.hasItem(`bpmHost`)) {
|
||||
this.alfrescoSettingsService.bpmHost = this.storage.getItem(`bpmHost`);
|
||||
this.settingsService.bpmHost = this.storage.getItem(`bpmHost`);
|
||||
this.bpmHost = this.storage.getItem(`bpmHost`);
|
||||
} else {
|
||||
this.alfrescoSettingsService.bpmHost = this.bpmHost;
|
||||
this.settingsService.bpmHost = this.bpmHost;
|
||||
}
|
||||
}
|
||||
|
||||
private setProvider() {
|
||||
if (this.storage.hasItem(`providers`)) {
|
||||
this.alfrescoSettingsService.setProviders(this.storage.getItem(`providers`));
|
||||
this.settingsService.setProviders(this.storage.getItem(`providers`));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { AlfrescoSettingsService, StorageService } from 'ng2-alfresco-core';
|
||||
import { SettingsService, StorageService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'alfresco-setting-demo',
|
||||
@@ -28,23 +28,23 @@ export class SettingComponent {
|
||||
ecmHost: string;
|
||||
bpmHost: string;
|
||||
|
||||
constructor(public alfrescoSettingsService: AlfrescoSettingsService,
|
||||
constructor(public settingsService: SettingsService,
|
||||
private storage: StorageService) {
|
||||
this.ecmHost = this.alfrescoSettingsService.ecmHost;
|
||||
this.bpmHost = this.alfrescoSettingsService.bpmHost;
|
||||
this.ecmHost = this.settingsService.ecmHost;
|
||||
this.bpmHost = this.settingsService.bpmHost;
|
||||
}
|
||||
|
||||
public onChangeECMHost(event: KeyboardEvent): void {
|
||||
console.log((<HTMLInputElement>event.target).value);
|
||||
this.ecmHost = (<HTMLInputElement>event.target).value;
|
||||
this.alfrescoSettingsService.ecmHost = this.ecmHost;
|
||||
this.settingsService.ecmHost = this.ecmHost;
|
||||
this.storage.setItem(`ecmHost`, this.ecmHost);
|
||||
}
|
||||
|
||||
public onChangeBPMHost(event: KeyboardEvent): void {
|
||||
console.log((<HTMLInputElement>event.target).value);
|
||||
this.bpmHost = (<HTMLInputElement>event.target).value;
|
||||
this.alfrescoSettingsService.bpmHost = this.bpmHost;
|
||||
this.settingsService.bpmHost = this.bpmHost;
|
||||
this.storage.setItem(`bpmHost`, this.bpmHost);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user