6
Kann mir bitte jemand helfenKann nicht konstant in Typoskript exportieren
Ich habe 2 Dateien main.ts und hi.ts
hi.ts:
export const hello = "dd";
main.ts:
import { hello } from "./hi";
...
class A {
public sayHello() {
console.log("hello=" + hello);
}
...
}
ich habe Ausnahme:
Uncaught ReferenceError: hello is not defined(…)
Wie kann ich diese const-Variable von Klasse A sehen? Ist es möglich?
Siehe diese Frage: http://StackOverflow.com/Questions/32647215/declaring-static-constants-in-es6-Classes – twicejr
Ich mache exportieren Const Hallo = "dd"; wie in Ihrem Link, aber es funktioniert nicht – EgorTitov
In Node.js oder in einem Browser? – Paleo