Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plunker with AngularJS and Typescript possible?

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.com/svdoever/AngularJS-bookviewer. Is it possible to have this code, preferably without the compiled Typescript files, up at http://plnkr.co?

I read at https://twitter.com/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 comments on his answer.

like image 998
Serge van den Oever Avatar asked Feb 04 '14 14:02

Serge van den Oever


3 Answers

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.org/Playground/

Update

You can use TypeScript anywhere you like using https://github.com/basarat/typescript-script (plunker sample : https://github.com/basarat/typescript-script#plunker)

That said many playgrounds now support TypeScript natively including plunkr : https://github.com/ggoodman/plunker-run-plugin/blob/master/README.md (just put "use typescript"; at the top of your file and add a tsconfig.json file 🌹

like image 187
basarat Avatar answered Nov 13 '22 11:11

basarat


You 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-compile/js/typescript.min.js"></script>
<script type="text/javascript" src="//niutech.github.io/typescript-compile/js/typescript.compile.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

like image 29
Blake Bowen Avatar answered Nov 13 '22 11:11

Blake Bowen


Use https://stackblitz.com/ instead, all live examples on angular.io use stackblitz now.

like image 1
Adamy Avatar answered Nov 13 '22 12:11

Adamy