Speed up your AngularJS app by limiting $digest cycles

We all know the speed of our app is very important and in the early stages of development there are rarely any issues with speed, but as the app grows and as we move into testing with real data we can see it getting slow unless we take speed into account throughout development.

When the user interacts with the UI, such as tying in an input box, Angular will run the $digest loop to see if anything has changed. The faster the cycle, the faster the two-way data binding and the better the user experience.

Continue Reading..

AngularJS $watch with debounce

When you want to use $scope.$watch to monitor changes to a variable in AngularJS you may not want to execute the watch on every scope change, so you need to use debounce. A debounce function limits the rate at which a function can fire.

You can use Underscore.js but you may not want to include the underscore library in your app in which case below is a angular version of debounce.Continue Reading..

Options for real time application development

Increasingly people expect websites to be interactive and respond to events in real time. This has been common for chat and instant messaging systems, but now we need to develop real time interaction into more and more web systems. We may need to push new items into a list, or update information as it changes in real time.

Continue Reading..