Angular 5: How to define color pallet in a central file
问题 I want to declare my color pallet in a central file in my project. Currently I am using an Injectable which contains a map, to reference all my used colors. Example: @Injectable() export class COLOR_DICTIONARY { private static COLOR_MAP: Map<string, string> = new Map<string, string>(); constructor() { COLOR_DICTIONARY.COLOR_MAP.set('primary', '#339988'); } get(key: string) { return COLOR_DICTIONARY.COLOR_MAP.get(key); } } However this forces me to reference all the colors in the markup