Commit ea758d92 authored by hasan khaddour's avatar hasan khaddour

add constant app name from enivoment

parent 059369e5
import { AfterViewInit, Component } from '@angular/core'; import { AfterViewInit, Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { ConfigurationService } from './core/services/configuration/configuration.service';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: './app.component.html', templateUrl: './app.component.html'
styleUrls: ['./app.component.css']
}) })
export class AppComponent { export class AppComponent {
title ="PSManagement";
constructor() { title =ConfigurationService.AppName;
}
//#region Application Costrucotr
constructor(private config : ConfigurationService) { }
//#endregion Application Costrucotr
} }
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app-routing.module';
// export const appConfig: ApplicationConfig = {
// providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)]
// };
import { TestBed } from '@angular/core/testing';
import { ConfigurationService } from './configuration.service';
describe('ConfigurationService', () => {
let service: ConfigurationService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ConfigurationService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
...@@ -6,11 +6,36 @@ import { environment } from '../../../../environments/environment'; ...@@ -6,11 +6,36 @@ import { environment } from '../../../../environments/environment';
providedIn: 'root' providedIn: 'root'
}) })
export class ConfigurationService { export class ConfigurationService {
//#region Constants
// application name
public static AppName=environment.applicationName;
//#endregion Constatns
//#region Dependencies
private baseUrl = environment.serverUrl ; private baseUrl = environment.serverUrl ;
//#endregion Dependencies
//#region Constructors
constructor() { } constructor() { }
//#endregion Constructors
//#region App name Accessor
public getAppName(){
return ConfigurationService.AppName;
}
//#endregion App name Accessor
//#region Server URL Accessor
public getServerUrl(){ public getServerUrl(){
return this.baseUrl ; return this.baseUrl ;
} }
//#endregion Server URL Accessor
} }
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
export const environment = { export const environment = {
production: false, production: false,
serverUrl: 'https://localhost:5001/api', serverUrl: 'https://localhost:5001/api',
applicationName:'نظام إدارة حالة المشاريع'
}; };
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment