$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...
What is Abstract class? -------------------------------------------------------------- The abstract keyword enables you to create classes and class members solely for the purpose of inheritance—to define features of derived, non-abstract classes A Sealed class -------------------------------------------------------------- It cannot be used as an abstract class as it cannot be used as a base class .A class member,method field,property or event on a derived class that is overriding a virtual member of the base class can declare that member as sealed class.This will prevent that method from being overriden in further derivation. This can be accomblished bu putting the sealed Keyword before the overridde keyword in the class member declaration. Polymorphism : -------------------------------------------------------------- C# recognises the method by its parameters and not only by its name.The return type of a method is never the part of the method signature if the nam...
Comments
Post a Comment