function unescapeText(text) {
      return text.replace(escapedStartRegexp, startSymbol).
        replace(escapedEndRegexp, endSymbol);
    }
@ngdoc method
@name $rootScope.Scope#$destroy
@kind function

@description
Removes the current scope (and all of its children) from the parent scope. Removal implies
that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer
propagate to the current scope and its children. Removal also implies that the current
scope is eligible for garbage collection.

The `$destroy()` is usually used by directives such as
{@link ng.directive:ngRepeat ngRepeat} for managing the
unrolling of the loop.

Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.
Application code can register a `$destroy` event handler that will give it a chance to
perform any necessary cleanup.

Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
clean up DOM bindings before an element is removed from the DOM.