Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Angular need Node Js? and what is role of Angular Cli?

I am a Beginner to Angular technology and came across this question.

why is Node js needed in Angular as Node js is a backend technology?

like image 226
Ashish Ahuja Avatar asked Feb 13 '19 13:02

Ashish Ahuja


2 Answers

You need NodeJs for angular if you intend to create a front end server, use typescript or make anything other than a purely in browser application(unless you use another server framework: Apache, nginx, lighttp, ruby/rails etc.). For example Vanilla javascript does not support require or import functionality so you need node to load file dependencies, and angularjs does not allow for server creation on its own. You can also choose to build angular applications in TypeScript which utilises NodeJs.

It is worth noting that technically speaking nodejs and angularjs are separate frameworks, angular can be run without node but would only support limited functionality(no db access, no server etc).

The CLI is needed in order to run angular commands through the command line, to generate services / components etc.

You can read more about angular here

like image 107
Jack Branch Avatar answered Nov 15 '22 10:11

Jack Branch


Angular does not need Node. However to make the dependencies management easier especially in package.json , npm which is a package manager is required. And in order to get npm, you need to install Node first.

As for angular cli, it provides a terminal that makes it easy to execute operations like creation of an angular app, angular components, building...

like image 24
Ines ben youssef Avatar answered Nov 15 '22 10:11

Ines ben youssef