1.

Explain the data binding process in AngularJS.

Answer»

Data binding is the process of automatic syncing of data between the view and the MODEL COMPONENTS. ANGULARJS achieves this by making use of the ng-model and ng-bind built-in directives. This directive ensures that the model is the single point of truth for the view and ensures that the view synchronizes with the model at any instant of time. There are two WAYS of data-binding:

  • One Way Data Binding: Changes in the model are reflected on the view but changes in the view to that data are not reflected on the model. The binding is one way from the model to view. This is ACHIEVED by making use of the ng-bind directive.
  • Two Way Data Binding: As the name itself suggests, the changes in the model are reflected on the view as well as the view changes are reflected in the model. This is achieved by making use of the ng-model directive.


Discussion

No Comment Found