6
Czy ktoś może mi pomóc proszęNie można eksportować stałej w maszynopisie
mam 2 pliki main.ts i hi.ts
hi.ts:
export const hello = "dd";
main.ts:
import { hello } from "./hi";
...
class A {
public sayHello() {
console.log("hello=" + hello);
}
...
}
mam wyjątek:
Uncaught ReferenceError: hello is not defined(…)
Jak mogę zobaczyć tę zmienną const z klasy A? Czy to możliwe?
Zobacz to pytanie: http://stackoverflow.com/questions/32647215/declaring-static-constants-in-es-es-classes – twicejr
Robię export const hello = "dd"; jak w linku, ale nie działa – EgorTitov
W Node.js lub w przeglądarce? – Paleo