we are building new Angular 4 project and trying to understand what approach will be the best for handling global constants which will be reused through all project.
I want to place all constants inside shared folder like so
shared
--constants
--dateTime.ts
--money.ts
--dialogConfig.ts
and use injectable token for each file
https://blog.thoughtram.io/angular/2016/05/23/opaque-tokens-in-angular-2.html
for example dialogConfig.ts will be
export let DIALOG = new InjectionToken<DialogConfig>('dialog-config');
export const DIALOG_CONFIG: DialogConfig = {
width : '600px',
height : 'auto'
};
So that each constant object will be saved from name collision and will be injectable.
What will be proc and cons for this approach?