Automatic Properties

Topics: Language Specification
Mar 28, 2014 at 4:31 PM
I am wondering if there is a way to do automatic properties similar to c#

Something like:

get propName;
set propName;

or more simply

property propName;

If not, why is it not provided?
Mar 28, 2014 at 4:34 PM
class Foo {
You can also provide a type annotation (propName: string;)
Mar 28, 2014 at 4:37 PM
Edited Mar 28, 2014 at 4:37 PM
That does not define an ECMASscript5 property getter/setter type propety (i.e. no defineProperty call is generated)
Mar 28, 2014 at 4:56 PM
There isn't a way to do this (other than by writing the getter and setter yourself). What are you trying to accomplish?