mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-28 21:05:43 +08:00
docs($rootScope): rename ttl to digestTtl + docs
This commit is contained in:
@@ -25,6 +25,30 @@
|
|||||||
* are expensive to construct.
|
* are expensive to construct.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ngdoc object
|
||||||
|
* @name angular.module.ng.$rootScopeProvider
|
||||||
|
* @description
|
||||||
|
*
|
||||||
|
* Provider for the $rootScope service.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ngdoc function
|
||||||
|
* @name angular.module.ng.$rootScopeProvider#digestTtl
|
||||||
|
* @methodOf angular.module.ng.$rootScopeProvider
|
||||||
|
* @description
|
||||||
|
*
|
||||||
|
* Sets the number of digest iteration the scope should attempt to execute before giving up and
|
||||||
|
* assuming that the model is unstable.
|
||||||
|
*
|
||||||
|
* The current default is 10 iterations.
|
||||||
|
*
|
||||||
|
* @param {number} limit The number of digest iterations.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc object
|
* @ngdoc object
|
||||||
* @name angular.module.ng.$rootScope
|
* @name angular.module.ng.$rootScope
|
||||||
@@ -37,7 +61,7 @@
|
|||||||
function $RootScopeProvider(){
|
function $RootScopeProvider(){
|
||||||
var TTL = 10;
|
var TTL = 10;
|
||||||
|
|
||||||
this.ttl = function(value) {
|
this.digestTtl = function(value) {
|
||||||
if (arguments.length) {
|
if (arguments.length) {
|
||||||
TTL = value;
|
TTL = value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ describe('Scope', function() {
|
|||||||
|
|
||||||
it('should prevent infinite recursion and print watcher expression',function() {
|
it('should prevent infinite recursion and print watcher expression',function() {
|
||||||
module(function($rootScopeProvider) {
|
module(function($rootScopeProvider) {
|
||||||
$rootScopeProvider.ttl(100);
|
$rootScopeProvider.digestTtl(100);
|
||||||
});
|
});
|
||||||
inject(function($rootScope) {
|
inject(function($rootScope) {
|
||||||
$rootScope.$watch('a', function() {$rootScope.b++;});
|
$rootScope.$watch('a', function() {$rootScope.b++;});
|
||||||
|
|||||||
Reference in New Issue
Block a user