Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum size of data that can be stored in angularjs scope? Performance of the application with heavy scopes?

Previously i have done some small small examples with Angular JS. I have a doubt on angular $scope in terms capability to store large data sets & performance with large data sets.

Example: In hotel booking systems(like http://www.hotels.com) , Usually Hotel APIs(Hotelbeds, DOTW...) gives hundreds of hotels for Bangkok, Dubai, Spain... etc like popular destinations.

My Question is,

  1. Can Application work without loosing performance when we assign this much data to Angular Scope?

  2. What is the maximum size of data that can be stored in Angular Scope?

like image 365
Hearaman Avatar asked Jul 16 '13 07:07

Hearaman


People also ask

What is the number of scopes allowed in an AngularJS application?

Each AngularJS application has exactly one root scope, but may have any number of child scopes.

What holds the data in an AngularJS application?

Applications in AngularJS are controlled by controllers. Read about controllers in the AngularJS Controllers chapter. Because of the immediate synchronization of the model and the view, the controller can be completely separated from the view, and simply concentrate on the model data.

What is the scope of AngularJS?

The Scope in AngularJS is the binding part between HTML (view) and JavaScript (controller) and it is a built-in object. It contains application data and objects. It is available for both the view and the controller. It is an object with available properties and methods.


1 Answers

In my experience when you work with a large amount of DOM nodes, each one containing several DOM nodes, sooner or later your application performances will be affected: it just happens to all javascript client side applications bacause it depends on your computer cpu and ram.

To avoid the problem it's a best pratice to work with small amount of data in your view and, of course, there are few techniques like infinite scrolling that help reaching the purpose. In general you should show in your view few dom nodes each time a user make an action (like scrolling, page changing, or filtering).

See this interesting article: AngularJS Virtual Scrolling

If you want to check an angularjs application performaces use Batarang

like image 147
Akallabeth Avatar answered Sep 21 '22 03:09

Akallabeth