You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now I'm running into to a problem where I can't access my generated enum values from my Angular view as I used to do because of the generated enums are defined under a declared module.
// my-component.tsexportclassMyComponent{MyEnum: typeofApiModel.MyEnum=ApiModel.MyEnum;}// ERROR: **ReferenceError: ApiModel is not defined**
Solution
The solution for this problem would be to generate types (e.g. enums) under an exported module (instead of a declared module as the declare keyword will not generate any JS code and only being used by the TS compiler)
So, it would be nice to have an option in the config file to choose between a declared module (e.g. model.d.ts) or an exported module (e.g. model.ts) when generating types.
The text was updated successfully, but these errors were encountered:
Problem
I used to access my
enum
values (in a type-safe way) from my Angular view whenever I needed, by exposing it from my component as below.E.g.
Now I'm running into to a problem where I can't access my generated
enum
values from my Angular view as I used to do because of the generated enums are defined under a declared module.Solution
The solution for this problem would be to generate types (e.g. enums) under an exported module (instead of a declared module as the
declare
keyword will not generate any JS code and only being used by the TS compiler)So, it would be nice to have an option in the config file to choose between a declared module (e.g.
model.d.ts
) or an exported module (e.g.model.ts
) when generating types.The text was updated successfully, but these errors were encountered: