In the type of script below, the code, regardless of whether the name is "public" or "private", the java script code that is generated is the same.
So my question is how to decide when there should be a public or private constructor parameter?
class Animal {
constructor( public name: string) {
}
}
var Animal = (function () {
function Animal(name) {
this.name = name;
}
return Animal;
}());
source
share