I was reading this http://www.typescriptlang.org/docs/handbook/decorators.html#class-decorators
but, Error can not find Symbol, I do not know what it is Symbol if this is part of reflect-metadata or it was part of reflect-metadata
import "reflect-metadata"; //change for my path
const formatMetadataKey = Symbol("format"); <-- Cannot find name 'Symbol'.
function format(formatString: string) {
return Reflect.metadata(formatMetadataKey, formatString); <-- Work
}
function getFormat(target: any, propertyKey: string) {
return Reflect.getMetadata(formatMetadataKey, target, propertyKey); <-- Work
}
I have to import something else to Symbol?, or this has changed, someone knows I'm doing wrong.
I think the solution is that Amid comment on ES6, for some circumstance, my TSconfig, was not working all that well, but after some changes worked, but as a note saying.
Cannot find name 'Symbol'variable ect or a simple newline, the editor indicates the error mentioned earlier, but if you recompile the error disappears and so all the time but seems to work.To get more info about Symbol read this document: link
To get rid of the error: target ES6 instead of ES5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With