AngularJS

AngularJS – $watch() , $digest() and $apply()

The AngularJS $scope functions $watch(), $digest() and $apply() are some of the central functions in AngularJS. Understanding $watch(), $digest() and $apply() is essential in order to understand AngularJS. When you create a data binding from somewhere in your view to a variable on the $scope object, AngularJS creates a "watch" internally. A watch means that… Continue reading AngularJS – $watch() , $digest() and $apply()

AngularJS

AngularJs – Asynchronous Behavior with Promises and $q

  what's  a promise ? A promise is a method of resolving a value (or not) in an asynchronous manner. Promises are objects that represent the return value or thrown exception that a function may eventually provide. Promises are incredibly useful in dealing with remote objects, and we can think of them as a proxy… Continue reading AngularJs – Asynchronous Behavior with Promises and $q

AngularJS

AngularJs – Custom Service

In this article we're going to learn why and how to build custom services in AngularJS. Before talking about service we need to talk about controller responsibilities. we use controllers to: Setup initial state of $scope. Add behaviors to the $scope. we DON'T use controllers to: Handle business logic directly. Share code state across controllers.… Continue reading AngularJs – Custom Service