Node.js is an open source JS framework that
· Helps in the execution of JavaScript code from server-side.
· Acts as a storehouse where you can get any JS framework by using Node Package Manager(NPM).
· Uses chrome Javascript engine to execute Javascript outside the browser for creating desktop and server-based applications.
· NPM is used for copying all the dependencies and packages to the local directory.
Reasons why there is a need for nodeJS in Angular:
· Angular is created in Typescript, which isn't supported by browsers. For compiling them into JavaScript, nodeJS is required.
· Most of the Angular libraries are assigned in the form of different NPM packages. NPM(Node Package Manager) relies more on Node.JS.
· NPM is responsible for minimizing the size of the Javascript files which basically helps in reducing application's size.
· Angular works on the client side, while for processing on the server side you will require NodeJS.
· NodeJS works as an intermediate for hosting in Angular and transferring data to the server side.
Conclusion:
Despite both NodeJS and Angular works on JavaScript but NodeJS makes Angular Development much easier. It also helps to reduce the size of Angular based application by using NodeJS in form of NPM. It's not necessary that you specifically need nodejs in Angular, but it makes AngularJS application more convenient.
Comments
Post a Comment