i want use typescript file like this:
<script type="text/typescript">
// ...
</script>
I found this: https://www.typescriptlang.org/play/index.html . This can compile typescript. Which is this compiler? I guess this is monaco i tried it but gives Uncaught TypeError: editor.getModel(...).getMode(...).getEmitOutput is not a function(…)
Is there compiler?
Sorry for my bad English.
Edit: I found compilers. But their typescript versions is old.
-
1Possible duplicate of Embed TypeScript code in an HTML documentDavid Sherret– David Sherret2016-07-20 15:56:36 +00:00Commented Jul 20, 2016 at 15:56
-
Well, is there compiler of newest version TypeScript?Recep Selim Ağırman– Recep Selim Ağırman2016-07-20 15:58:24 +00:00Commented Jul 20, 2016 at 15:58
-
There's a pull request for typescript compile for the newest stable version.David Sherret– David Sherret2016-07-20 15:59:55 +00:00Commented Jul 20, 2016 at 15:59
Add a comment
|
1 Answer
This is a version I wrote that directly uses the version from Microsoft/TypeScript/master so it always stays up to date: https://github.com/basarat/typescript-script
<script type="text/typescript">
setTimeout(()=>console.log('hello'));
</script>
You can even point ts to any other TypeScript version you might have and it will work fine 🌹
1 Comment
Recep Selim Ağırman
I tried this. Can you look this issue, please?: github.com/basarat/typescript-script/issues/2