Karthikeyan sundaramoorthi Karthikeyan sundaramoorthi - 1 year ago 861
Node.js Question

Is nodejs mandatory for angular2, can I run with apache server?

I am using angular2 with nodejs, how about using apache/xampp. will it support or nodejs npm server is mandatory for angular2

Answer Source

NodeJS is Mandatory for angular2 !

let me tell you why?

Angular2 comes with typescript support which is transpiled into javascript.

NodeJS offers typings & other dependency packages like SystemJS,RxJS which helps angular2 do thye magic you call Angular.

Though you could run angular2 apps in Xampp but recommended approach will be with NodeJS as it offers a lot more flexibility & framework support for development.

for eg. Angular-Cli is node module which helps you setup your project really fast.

On top of that node gives you flexibilty to add third party libraries easily into your project.

You can use Xampp but then you will need your server to load transpiler manually which will transpile ts files into javascript files as currently there is no support in Xampp as far as I know and that will be quite a task to do.

So I will go with NodeJS on this.