QAs

 Does angularjs controller are executed on the server or the client?


In short, yes. All of the angular code, from the partial html, to the controllers are executed on the client. The servers job is to send these files up to the client when they are needed.

You can tell that the angular controllers are run on the client because you used a script tag to load them in the index.html file.

This is a fundamental part of SPAs (Single Page Applications), where a lot of the expensive computing work happens on the client, instead of the server. This is usually a good thing, as almost every bodies computer is now powerful enough to handle running the code. The server now has less work to do, which is even better when considering how much it can cost to scale up a server for many users.

If this sounds like Angular applications are similar to traditionally native applications that would be installed on a users computer, then you are correct. Angular is mostly meant for Applications that use the browser as the delivery system. It just happens to be that a lot of developers thought that you could start making more traditional websites in the style of an application.


MVC Model View Controller Architecture

MVV Model View View Model Architecture

Comments

Popular posts from this blog

9. Angular and MongoDBs

1. a. Angular Application Setup

2. Structural Directives - ngIf