So, I have 2 files: (1) conveyor-status.ts
(2) overview.component.ts
. There is a statement inside overview.component.ts
which goes: public possibleStatusses: string[] = Object.keys(ConveyorStatus);
.
Now, here's the tricky part. When the contents of conveyor-status.ts
is:
export enum ConveyorStatus {
Stopped = "Stopped",
Estop = "Estop",
DisconnectFault = "DisconnectFault",
Manual = "Manual",
EncoderFault = "EncoderFault",
Jam = "Jam",
Full = "Full",
Fault = "Fault",
EnergyManagement = "EnergyManagement",
CascadeStop = "CascadeStop",
Running = "Running",
}
the value of possibleStatusses
is: ["Stopped", "Estop", "DisconnectFault", "Manual", "EncoderFault", "Jam", "Full", "Fault", "EnergyManagement", "CascadeStop", "Running"]
which is desired.
Unfortunately, I cannot change the contents of conveyor-status.ts
(due to a large number of other files depending upon the established structure), and hence, that file MUST be as below:
export enum ConveyorStatus {
Stopped, // default 0
Estop, // 1
DisconnectFault, // 2
Manual, // 3
EncoderFault, // 4
Jam, // 5
Full, // 6
Fault, // 7
EnergyManagement, // 8
CascadeStop, // 9
Running, // 10
}
As soon as I switch it to what is MUST be, the value of possibleStatusses
changes to: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Stopped", "Estop", "DisconnectFault", "Manual", "EncoderFault", "Jam", "Full", "Fault", "EnergyManagement", "CascadeStop", "Running"]
.
I am completely unable to understand why is this happening. Can someone please help me with this?