function getTestability(rootElement) {
  var injector = angular.element(rootElement).injector();
  if (!injector) {
    throw ngMinErr('test',
      'no injector found for element argument to getTestability');
  }
  return injector.get('$$testability');
}
@name angular.getTestability
@module ng
@description
Get the testability service for the instance of AngularJS on the given
element.
@param {DOMElement} element DOM element which is the root of AngularJS application.