Default. TypeScript Documentation
In the following definition
class Person implements IFieldValue{
name: string;
value: string;
constructor (name: string, value: string) {
this.name = name;
this.value = value;
}
}
Attributes <Person>.nameand <Person>.valuepublicly accessible by default.
since they are here
class Person implements IFieldValue{
constructor(public name: string, public value: string) {
this.name = name;
this.value = value;
}
}
:. , this.name this.value .
class Person implements IFieldValue{
constructor(name: string, value: string) {
this.name = name;
this.value = value;
}
}
,
class Person implements IFieldValue{
private name: string;
private value: string;
constructor (name: string, value: string) {
this.name = name;
this.value = value;
}
}
class Person implements IFieldValue{
constructor (private name: string, private value: string) {}
}
, , , .