angular / ts-minify

A tool to aid minification of Typescript code, using Typescript's type information.
Apache License 2.0
121 stars 7 forks source link

Constructor parameter property declaration #57

Closed dariajung closed 9 years ago

dariajung commented 9 years ago

Parameter properties need to be desguared, or handled otherwise:

class Animal {
    constructor(private name: string) { 
        console.log(name);
    }
}

is sugar for

class Animal {
    private name: string;
    constructor(name: string) { 
        this.name = name;
    }
}

name is a property that, if renamed in the parameter property declaration, also needs to be renamed in the constructor body if used.

dariajung commented 9 years ago

Duplicate of #39. Moving comments over.