Yes. You may have a config in an external file. The easiest approach is to do something like this:
class Constants { static get Default():any { return { appName: "My App", appVersion: 2.0, baseUrl: "http://localhost:3048", Action: { None:0, Registering: 1, Authenticating: 2 } }; } }
And then you can access it through Constants.Default . So your constant method in angular would look like this:
.constant("appConstant", Constants.Default);
More Typescript will return types instead of the object literal in the default get () method. So you can go and reorganize my example if you want.
source share