How does Angular use Node?

16 views
Skip to first unread message

Ronald Rex

unread,
Jan 26, 2019, 7:56:06 PM1/26/19
to Angular and AngularJS discussion
Hello Friends, I was wondering how does Angular use Node? I am new to Angular and I notice that 
many of the article that I read refer to Node.js, but I dont have enough information or background knowledge
to understand how Angular uses Node. Thanks !!!!

Sander Elias

unread,
Jan 27, 2019, 2:23:26 AM1/27/19
to Angular and AngularJS discussion
Hi Ronald.

Easy question. It's not using NodeJs at all.
That is, your Angular app is not at all using/depending on NodeJs, but the tools you use to build/develop your application are.
It's like a car, to build one, you need a pretty elaborate workshop. Once its done, its done. You only return it to a workshop for maintenance.

Regards
Sander

Binh GIIK

unread,
Jan 27, 2019, 1:37:05 PM1/27/19
to ang...@googlegroups.com
AngularJS is NOT depending on Node modules. But AngularIO is. If you install AngularIO framework today, it'll come with a "node_modules" library that contains many dependencies like NodeJS does. However, AngularIO framework itself doesn't call library like "const test = require (test)" like the NodeJS server does. AngularIO is using "import xxx from '@angular/core'" statement to bring in dependencies for your AngularIO project.
AngularJS can be used for embedding on any html file but AngularIO can't. It has its own environment and router and behaves like a standalone app on its own server.
Hope that helps.

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Jan 27, 2019, 2:17:46 PM1/27/19
to Angular and AngularJS discussion
Hi Binh,

First, let us get our facts straight:
  1, AngularJs is Angular 1.x. The version that started modern frameworks.
  2. AngularIO is the documentation and the website for Angular.
  3. Angular is the current framework we work with. It is just Angular.
  4. NodeJs is a tool that was created t write server's in JS, but as it turns out ist also great for tooling
  5. NPM packages. NPM packages are stored in a folder called node_modules.  There are 3rth party libraries that are distributed with this system.

To build an application/website that uses Angular, you need tools. Those tools use NodeJS and it's ecosystem.  Once you are done the building, you don't need any of it anymore. 
If you do a production build, you end up with a static website. Most likely this website will talk to an API server, but even that is optional.

So yes, you need to to be able to BUILD an angular app. Just as you need a workshop to build a car.
Once done, you don't need NodeJs at all anymore. just as you don't need a workshop to drive the car. 

And yes, when you get started with angular, you are getting a "workshop" (The CLI) including pretty awesome tooling with it, but you don't have to use it. You can bring your own tools if you want. 
Again, none of those tools are really required. But they make your life so much easier.

Regards
Sander





Reply all
Reply to author
Forward
0 new messages