ChuckP
ChuckP

Reputation: 33

What are dynamic views in Angular JS?

On the AngularJS web site, what is meant by dynamic views when it says, "the root problem is that HTML was not meant for dynamic views"?

Upvotes: 3

Views: 642

Answers (3)

Evan Bechtol
Evan Bechtol

Reputation: 2865

HTML Pages were initially created to serve static webpages. In other words, pages that do not rely on asynchronous interaction of some kind, to provide dynamic data from any of the following sources: databases, other sites, systems, or users.

When using dynamic design approach, anytime that you send/receive data that is done through some sort of interaction, either from the user or the website/webserver, this is considered dynamic and the page is updated dynamically (with Angular.js in this case).

In Angular.js, the concept of "dynamic views" comes from the framework MV*, which is implemented through the following elements:

  1. Model to contain the data
  2. View that the user is able to view and interact with data
  3. Controllers(*) that handle the translation from the view to the model and vice versa. (This also includes services/factories/directives, etc.)

This interaction enables the creation of dynamic "views" that are able to incorporate new data as needed. Dynamic sites give the feeling that the user is on the same page, but new data is able to be presented. This leads to an improved UX in most cases.


Further Reading:
Good Article on MV* Framework
Comparison of 4 MV* Frameworks

Upvotes: 4

Ramin Esfahani
Ramin Esfahani

Reputation: 220

Let me elaborate the dynamic-views as this way for you: In AngularJS pages content can partially updated by different routes. You can do this with some directives like ng-view which you define seperated HTML file for different routes and the pages contents dynamically updated based on defined routes without reloading the entire page. Regards

Upvotes: 0

Edmundo Santos
Edmundo Santos

Reputation: 8287

Content loaded dynamically, typically via ajax, or websocket. A simple view that consumes JSON service showing some data, is a dynamic view.

Upvotes: 0

Related Questions