Update on Person.ts file:
export class Person {
private _name: string;
constructor(name: string) {
this._name = name;
}
get name(): string {return this._name};
}
Recent changes in test.ts script:
import {Person} from "./Person";
let user = new Person("John");
document.getElementById("h1").innerHTML = user.name;
Updated tsconfig.json configuration:
{
"compilerOptions": {
"target": "es5"
,"outDir" : "build"
}
}
Error message displayed in Chrome's console:
Uncaught ReferenceError: exports is not defined
at test.js:2