How does two-way data binding work in AngularJS?
Hi everyone! I started learning AngularJS and I can't understand how two-way data binding works. I read the documentation, but I'm still confused.\n\nI have a simple input form example. I want the text on the page to automatically update when I change the text in the input field. I'm using the ng-model directive, but I don't understand what's happening under the hood.\n\nHere's my code:\n\n```javascript\n// app.js\nvar app = angular.module('myApp', []);\napp.controller('myCtrl', function($scope) {\n $scope.name = 'John Doe';\n});\n```\n\n```html\n\n
\n \n
\n```\n\nIt works, but I don't understand:\n1. How does AngularJS know that the value in the input Hello, {{ name }}!
\n