mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
reafactor: Rename ng:bind-immediate -> ng:model-instant
This commit is contained in:
parent
139e1b09a9
commit
c4c60c25b4
4 changed files with 9 additions and 9 deletions
|
|
@ -101,7 +101,7 @@
|
|||
|
||||
<div id="sidebar">
|
||||
<input type="text" ng:model="search" id="search-box" placeholder="search the docs"
|
||||
tabindex="1" accesskey="s" ng:bind-immediate>
|
||||
tabindex="1" accesskey="s" ng:model-instant>
|
||||
|
||||
<ul id="content-list" ng:class="sectionId" ng:cloak>
|
||||
<li ng:repeat="page in pages | filter:search" ng:class="getClass(page)">
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ function publishExternalAPI(angular){
|
|||
ngModel: ngModelDirective,
|
||||
ngList: ngListDirective,
|
||||
ngChange: ngChangeDirective,
|
||||
ngBindImmediate: ngBindImmediateDirective,
|
||||
ngModelInstant: ngModelInstantDirective,
|
||||
required: requiredDirective,
|
||||
ngRequired: requiredDirective
|
||||
}).
|
||||
|
|
|
|||
|
|
@ -1004,22 +1004,22 @@ var ngChangeDirective = valueFn({
|
|||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name angular.module.ng.$compileProvider.directive.ng:bind-immediate
|
||||
* @name angular.module.ng.$compileProvider.directive.ng:model-instant
|
||||
*
|
||||
* @element input
|
||||
*
|
||||
* @description
|
||||
* By default, Angular udpates the model only on `blur` event - when the input looses focus.
|
||||
* If you want to update after every key stroke, use `ng:bind-immediate`.
|
||||
* If you want to update after every key stroke, use `ng:model-instant`.
|
||||
*
|
||||
* @example
|
||||
* <doc:example>
|
||||
* <doc:source>
|
||||
* First name: <input type="text" ng:model="firstName" /><br />
|
||||
* Last name: <input type="text" ng:model="lastName" ng:bind-immediate /><br />
|
||||
* Last name: <input type="text" ng:model="lastName" ng:model-instant /><br />
|
||||
*
|
||||
* First name ({{firstName}}) is only updated on `blur` event, but the last name ({{lastName}})
|
||||
* is updated immediately, because of using `ng:bind-immediate`.
|
||||
* is updated immediately, because of using `ng:model-instant`.
|
||||
* </doc:source>
|
||||
* <doc:scenario>
|
||||
* it('should update first name on blur', function() {
|
||||
|
|
@ -1034,7 +1034,7 @@ var ngChangeDirective = valueFn({
|
|||
* </doc:scenario>
|
||||
* </doc:example>
|
||||
*/
|
||||
var ngBindImmediateDirective = ['$browser', function($browser) {
|
||||
var ngModelInstantDirective = ['$browser', function($browser) {
|
||||
return {
|
||||
require: 'ngModel',
|
||||
link: function(scope, element, attr, ctrl) {
|
||||
|
|
|
|||
|
|
@ -923,10 +923,10 @@ describe('input', function() {
|
|||
});
|
||||
|
||||
|
||||
describe('ng:bind-change', function() {
|
||||
describe('ng:model-instant', function() {
|
||||
|
||||
it('should bind keydown, change, input events', inject(function($browser) {
|
||||
compileInput('<input type="text" ng:model="value" ng:bind-immediate />');
|
||||
compileInput('<input type="text" ng:model="value" ng:model-instant />');
|
||||
|
||||
inputElm.val('value1');
|
||||
browserTrigger(inputElm, 'keydown');
|
||||
|
|
|
|||
Loading…
Reference in a new issue