In TypeScript classes it’s possible to declare types for properties, for example:
class className {
property: string;
};
How do declare the type of a property in an object literal?
I’ve tried the following code but it doesn’t compile:
var obj = {
property: string;
};
I’m getting the following error:
The name ‘string’ does not exist in the current scope
Am I doing something wrong or is this a bug?