I have some code I would like to ask questions about on stackoverflow. The code is written in AngularJS with Typescript, and does manipulation and watching of the $location.hash. I now have the code on github at . Is it possible to have this code, preferably without the piled Typescript files, up at ?
I read at that Typescript should be suported on .
Edit:
Solution by Bassarat to add a gh-pages branch to the git repository did the job. See ments on his answer.
I have some code I would like to ask questions about on stackoverflow. The code is written in AngularJS with Typescript, and does manipulation and watching of the $location.hash. I now have the code on github at https://github./svdoever/AngularJS-bookviewer. Is it possible to have this code, preferably without the piled Typescript files, up at http://plnkr.co?
I read at https://twitter./filearts/status/290961349092208642 that Typescript should be suported on http://plunkr.co.
Edit:
Solution by Bassarat to add a gh-pages branch to the git repository did the job. See ments on his answer.
Share Improve this question edited Feb 7, 2014 at 8:55 thomaux 19.7k10 gold badges81 silver badges104 bronze badges asked Feb 4, 2014 at 14:58 Serge van den OeverSerge van den Oever 4,3929 gold badges50 silver badges69 bronze badges 2- Just follow the link on the tweet, fork the Plunk and add Angular? – thomaux Commented Feb 4, 2014 at 15:23
- @Anzeo: And if you follow the link in the tweet you can see that the typescript code does not work. It looks like the typescript code is never piled. – Serge van den Oever Commented Feb 4, 2014 at 16:17
5 Answers
Reset to default 7You can use TypeScript Compile to transform your TypeScript files into JavaScript.
Reference your TS files like this:
<script type="text/typescript" src="app.ts"></script>
And add these two JS files at the end of the HTML body:
<script type="text/javascript" src="//niutech.github.io/typescript-pile/js/typescript.min.js"></script>
<script type="text/javascript" src="//niutech.github.io/typescript-pile/js/typescript.pile.js"></script>
Kos Prov created a working TypeScript Plunker here.
Update
You can use SystemJS to load TypeScript files, although you'll need to manually bootstrap Angular.
http://plnkr.co/edit/kFsJ7q?p=preview
It isn't supported by plunker. But I tend to use http://typescript.io/ when I need third party lib support (e.g. angularjs). Otherwise I just stick with TypeScript Playground http://www.typescriptlang/Playground/
Update
You can use TypeScript anywhere you like using https://github./basarat/typescript-script (plunker sample : https://github./basarat/typescript-script#plunker)
That said many playgrounds now support TypeScript natively including plunkr : https://github./ggoodman/plunker-run-plugin/blob/master/README.md (just put "use typescript";
at the top of your file and add a tsconfig.json
file