Open dariajung opened 9 years ago
Another example:
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.
Example illustrating this example: