0

How can I open angular2 and TypeScript project in visual studio without npm/nodejs. I need to open the project in computer without network.

thank you

DinDan
  • 147
  • 1
  • 1
  • 11
  • All you need is the Node_modules folder and you can run an angular 2 application – Bean0341 Nov 03 '16 at 16:01
  • @Bean0341, How can I compile the typescript to js files? – DinDan Nov 03 '16 at 19:25
  • aww yes I understand the question now, you have to have something to manage the typescript conversion.... I am of no use here :p However I have also heard of gulp but if you are going to use gulp then you might as well just use npm.... – Bean0341 Nov 03 '16 at 20:32

1 Answers1

0

In VS create new project -> TypeScript -> HTML Application with TypeScript. You will have Typescript transpiler set by default. Now you need angular 2. According to this answer you need to add these scripts to your page:

<script src="https://code.angularjs.org/2.0.0-beta.2/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/tools/system.js"></script>
<script src="https://code.angularjs.org/tools/typescript.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.2/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.2/angular2.dev.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.2/http.dev.js">

You also have to configure SystemJS as shown in the example i provided earlier.

Community
  • 1
  • 1
Piotr Ptak
  • 461
  • 6
  • 15