$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...
In Elizabeth's day care center, the teacher helps the kids to build all kinds of toys to develop their creative skills. One of Elizabeth's favorite activities is to make animals with play-dough. A set of molds is the tool that Elizabeth always uses to create her favorite cool animals. One mold tool set includes five parts, including the head, body, arm, leg, and tail. Whenever Elizabeth wants to build an animal, she will use one set of each tools to make a head, body , leg, arm, and tail for that animal, and then assembles them with glue to build an animal. There are many types of animal mold tool sets that the kids can choose from. For example: if Elizabeth wants to make a monkey, then she will pick the set of monkey molds to start. Step 1. Make monkey head. Step 2. Make monkey body. Step 3. Make monkey leg. Step 4. Make monkey arm. Step 5. Make monkey tail. Once all the five parts are finished, then Elizabeth will glue them a...
Comments
Post a Comment