diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 8461c61d..ab642338 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -2466,9 +2466,9 @@ var ngValueDirective = function() { form will update the model only when the control loses focus (blur event). If `escape` key is pressed while the input field is focused, the value is reset to the value in the current model. - + -
+
Name: - function Ctrl($scope) { - $scope.user = { name: 'say', data: '' }; + angular.module('optionsExample', []) + .controller('ExampleController', ['$scope', function($scope) { + $scope.user = { name: 'say', data: '' }; - $scope.cancel = function (e) { - if (e.keyCode == 27) { - $scope.userForm.userName.$rollbackViewValue(); - } - }; - } + $scope.cancel = function (e) { + if (e.keyCode == 27) { + $scope.userForm.userName.$rollbackViewValue(); + } + }; + }]); var model = element(by.binding('user.name')); @@ -2520,9 +2521,9 @@ var ngValueDirective = function() { This one shows how to debounce model changes. Model will be updated only 1 sec after last change. If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty. - + -
+
Name: - function Ctrl($scope) { - $scope.user = { name: 'say' }; - } + angular.module('optionsExample', []) + .controller('ExampleController', ['$scope', function($scope) { + $scope.user = { name: 'say' }; + }]); */