I have a typescript file containing a class definition:
if (window.console == null) {
(<any>window).console = {
error: function (a) {
},
log: function (a) {
}
};
}
class SendMessage {
//.....
}
After the compilation to javascript (by VS2015), I get the error on the line with the class definition:
Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
I have found that I have to use the strict mode. But why and how can I use it in typescript?
Thanks