In this article we will look what angular js is and the scenarios where angular js might be the right fit for your web application.
What is angular js?
When to use Angular?
How does Angular works?
Application logic and data are separated when using Angular. Application logic resides on client side and angular uses directives, bindings, filters , expressions etc to structure the application on client side.
Controllers, Services and Models are used to glue all the logic and data operations together. As mentioned, data and logic are separated so this means that your data (the dynamic stuff), your HTML templates (the static stuff), and your logic (the controllers and binding markup) work together to make the application work.
The majority of the data fetched for a HTML page is either redundant or stateless , so making it 100% static is a good idea right? Angular does this and it does it well.
So the good part is that if all the static stuff can be cached for longer and your dynamic responses are smaller. This is great for caching server-side responses and greatly reducing the amount of work that the server has to do to generate the HTML response.
You can have a entire web application as an angular app or you can have part of you web application as an angular app. Either case, in order to indicate the browser, that a certain portion of your web application is angular , you have to use ng-App directive
<p>Name: <input type=“text” ng-model=“name”></p>
ng-App directive tells the browser that the div is the owner of the angular js application. Now that we have defined the angular app , lets move on to other parts of an angular app.