First of all, do the following:
- Create a domain folder inside src. We'll put all of our domain-related modules inside of it.
- Now, go ahead and create a country.ts file within the src/domain folder.
In that file, define the Country class:
export class Country {
constructor(
private _name: string,
private _id: string,
private _iso2Code: string,
private _capitalCity: string,
private _longitude: string,
private _latitude: string
) {
}
}
Inside the class, add the following accessors:
get name() {
return this._name;
}
get id(): string {
return this._id;
}
get iso2Code(): string {
return this._iso2Code;
}
get capitalCity(): string {
return this._capitalCity;
}
get longitude(): string {
return...