1.

What is two-way data binding? Which directive is used for the two-way data binding?

Answer»
  • Two-way data-binding means that UI (User Interface) fields are found to model data. Therefore, in the CASE of the UI field changes, the model data also changes and vice-versa so both are the source of truth. The two-way binding is associated with several side effects that are difficult to identify and UNDERSTAND
  • In two-way data binding, the view (UI) PART of the application updates automatically when the data model is modified. In Vue.js the directive v-model is used for two-way data binding. 
  • Generally, in the two-way data binding, the UI part of the application usually updates automatically when the data model is changed. 
  • V-model - is a directive for two way data binding. It automates the updating of input by picking the correct way. 
<input v-model="message" PLACEHOLDER="edit me">  <p>Message is: {{ message }}</p>   

When the VALUE in the input field changes ‘message’ in the p tag automatically updates. 



Discussion

No Comment Found

Related InterviewSolutions