How does AngularJS handle Memory -
i wondering how angularjs 'saves' data/model. save or.. how work?
we using different methods retrieve json data. in other frameworks jquery had think how store data locally, i.e. when want provide sorting possibility. in angular seems different, seems out of box.
is angular displays how supposed , looks @ changes, reads in displayed data in , displays differently or use local storage save raw json.. , work there? (this limit amount of data can feed)
here simple code-example:
$http.get("url-to-json") .success(function(returneddata) { $scope.search_result = returneddata['search_result']; })
from there can use:
<div ng-repeat='result in search_results | sortresult:"price":sorted' id="res_<% result.id %>" class="result"> product: <% result.name %> </div>
i riddled how angular still knows data , doesn't have load again external source.
do know?
there lot more goes it, stored in local memory. angular creates object of scope properties. when data binding in angular registering event listener , when event called angular loops through object detecting if has changed, , if updates object accordingly. each time update occurs returns loop check if else has been updated. referred $digestloop
.
source
the ng-book
Comments
Post a Comment