YouTip LogoYouTip

Ng Ng Model

# AngularJS `ng-model` Directive [![Image 3: AngularJS Reference](#) AngularJS Reference](#) * * * ## AngularJS Example Bind the value of an input box to a scope variable:
var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.name = "John Doe"; }); [Try it Β»](#) * * * ## Definition and Usage The **ng-model** directive binds an HTML form element to a scope variable. If the variable does not exist in the scope, it will be created. * * * ## Syntax The ``, ``, `