How to access a constant in an Angular 2 component and service?

后端 未结 5 916
你的背包
你的背包 2020-11-28 12:45

I have a constants file constants.ts:

export const C0NST = \"constant\";

I access it in a service some.service.ts<

5条回答
  •  渐次进展
    2020-11-28 13:15

    You can create a BaseComponent , it is a place where you should create your constant instances and then you can create your FooComponent extends BaseComponent and you can use your constants.

提交回复
热议问题