$watch keeps track of a variable and its value <div ng-controller="mycontroller"> <input ng-model="a"> <div> {{ b }}</div> </div> app.controller('mycontroller',function(){ $scope.a=1; $scope.b=2; }) whenever a databinding with the scope variable is created , a $watch will automatically be created by the angular js framework $watch -a:1 and $watch -b:2, And this will be used by the digest cycle . Since C is not used in any databinding , so $watch is not created for variable c. If the value gets changes for those variable, angular performs necessary updates to the DOM elements With the help pg $watch custom functions can be created which are called $watchListeners and this gets executed as soon a the value of the variables is changed They are mainly used for databinding and angular Js constantly uses watchers behind the scene number of watchers should be kept less the 2000 There are number of ways to get...
Asynchronous Programming Using Delegates Delegates can be used to call the Synchronous methods in a Asynchronous manner .When we call the delegate synchronously The invoke method is calls the target method directly on the main thread.If the BeginInvoke method is called the "common language runtime" queues the request and returns immediatly to the caller.The target method is called asynchronously on a thread from a thread pool.The original thread which submitted the request is now free and can execute in parallel to the target Thread.If a callback method is specified on the in the call to the BeginInvoke method,the callback method is called when the target method ends.In the Call Back method the EndInvoke Method obtains the return value and any input/output or output only parameters. If no callback method is specified when calling BeginInvoke ,EndInvoke can be called from the thread that called BeginInvoke. The .Net Framework thus enables calling method Asynchronous...
Comments
Post a Comment