* @ngdoc service * @name $rootScope * @this * * @description * * Every application has a single root ng.$rootScope.Scope scope. * All other scopes are descendant scopes of the root scope. Scopes provide separation * between the model and the view, via a mechanism for watching the mod
()
| 17758 | * {@link guide/scope developer guide on scopes}. |
| 17759 | */ |
| 17760 | function $RootScopeProvider() { |
| 17761 | var TTL = 10; |
| 17762 | var $rootScopeMinErr = minErr('$rootScope'); |
| 17763 | var lastDirtyWatch = null; |
| 17764 | var applyAsyncId = null; |
| 17765 | |
| 17766 | this.digestTtl = function(value) { |
| 17767 | if (arguments.length) { |
| 17768 | TTL = value; |
| 17769 | } |
| 17770 | return TTL; |
| 17771 | }; |
| 17772 | |
| 17773 | function createChildScopeClass(parent) { |
| 17774 | function ChildScope() { |
| 17775 | this.$$watchers = this.$$nextSibling = |
| 17776 | this.$$childHead = this.$$childTail = null; |
| 17777 | this.$$listeners = {}; |
| 17778 | this.$$listenerCount = {}; |
| 17779 | this.$$watchersCount = 0; |
| 17780 | this.$id = nextUid(); |
| 17781 | this.$$ChildScope = null; |
| 17782 | this.$$suspended = false; |
| 17783 | } |
| 17784 | ChildScope.prototype = parent; |
| 17785 | return ChildScope; |
| 17786 | } |
| 17787 | |
| 17788 | this.$get = ['$exceptionHandler', '$parse', '$browser', |
| 17789 | function($exceptionHandler, $parse, $browser) { |
| 17790 | |
| 17791 | function destroyChildScope($event) { |
| 17792 | $event.currentScope.$$destroyed = true; |
| 17793 | } |
| 17794 | |
| 17795 | function cleanUpScope($scope) { |
| 17796 | |
| 17797 | // Support: IE 9 only |
| 17798 | if (msie === 9) { |
| 17799 | // There is a memory leak in IE9 if all child scopes are not disconnected |
| 17800 | // completely when a scope is destroyed. So this code will recurse up through |
| 17801 | // all this scopes children |
| 17802 | // |
| 17803 | // See issue https://github.com/angular/angular.js/issues/10706 |
| 17804 | if ($scope.$$childHead) { |
| 17805 | cleanUpScope($scope.$$childHead); |
| 17806 | } |
| 17807 | if ($scope.$$nextSibling) { |
| 17808 | cleanUpScope($scope.$$nextSibling); |
| 17809 | } |
| 17810 | } |
| 17811 | |
| 17812 | // The code below works around IE9 and V8's memory leaks |
| 17813 | // |
| 17814 | // See: |
| 17815 | // - https://code.google.com/p/v8/issues/detail?id=2073#c26 |
| 17816 | // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909 |
| 17817 | // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451 |
nothing calls this directly
no test coverage detected