This project is read-only.

Automatic Properties

Topics: Language Specification
Mar 28, 2014 at 5: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 5:34 PM
class Foo {
You can also provide a type annotation (propName: string;)
Mar 28, 2014 at 5:37 PM
Edited Mar 28, 2014 at 5:37 PM
That does not define an ECMASscript5 property getter/setter type propety (i.e. no defineProperty call is generated)
Mar 28, 2014 at 5: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?