Issue
I have this code in typescript
:
export enum A {
name = 'A',
}
export enum Names {
nameA = A.name, // ERROR
nameB = 'B',
}
The error I get is Computed values are not permitted in an enum with string valued members.
on the line nameA = A.name
. How can I assign the value from a different enum?
Solution
I don't think you can do that. You'd just have to define it again.
export enum A {
name = 'A',
}
export enum Names {
nameA = 'A',
nameB = 'B',
}
Answered By - Soumya Mukhija
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.