Monday, April 4, 2016

Getting Starting - Visual Studio Code and AngularJS 2

Before we have Node.js installed lets host our AngualrJS 2 Application on IIS

All we have to do, Create new Web Site under IIS and then we have to add web.config to our application:

<configuration>
    <system.webServer>
    <staticContent>
      <remove fileExtension=".ts" />
      <mimeMap fileExtension=".ts" mimeType="text/x-typescript" />
    </staticContent>
    <!-- Some other content -->
</system.webServer>
</configuration>

Otherwise by default IIS will block *.ts (typescript) files.

Create simple AngularJS 2 application following any guide, for instance this one:

https://angular.io/docs/ts/latest/quickstart.html#!#devenv

Then copy your html and ts files under new Web Site and refresh IIS and.

Go to url, for instance: http://localhost/AngularJS_2_Tryout/index.html

And you can host your AngularJS 2 application on IIS.