I'm newbie use typescript. In my project have knockout ts, after compile (Intellij plugin auto compile ts -> js)
this is file sample.ts:
import * as ko from "knockout"; ko;
class HelloViewModel {
language: KnockoutObservable<string>
framework: KnockoutObservable<string>
constructor(language: string, framework: string) {
this.language = ko.observable(language);
this.framework = ko.observable(framework);
}
}
ko.applyBindings(new HelloViewModel("TypeScript", "Knockout"));
sample.js:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ko = require("knockout");
ko;
var HelloViewModel = /** @class */ (function () {
function HelloViewModel(language, framework) {
this.language = ko.observable(language);
this.framework = ko.observable(framework);
}
return HelloViewModel;
}());
ko.applyBindings(new HelloViewModel("TypeScript", "Knockout"));
when run on browser it notice error: Uncaught ReferenceError: exports is not defined at sample.js:2
I try to search but still not find solution. Please show me if you have a way to solve it.
This my project: https://github.com/hoangdangduy/StreamingVideoWeb