aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Angular.js28
-rw-r--r--src/AngularPublic.js26
-rw-r--r--test/testabilityPatch.js31
3 files changed, 31 insertions, 54 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 9b0c4e23..29199f9b 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -1015,6 +1015,34 @@ function assertArgFn(arg, name) {
return arg;
}
+function publishExternalAPI(angular){
+ extend(angular, {
+ // disabled for now until we agree on public name
+ //'annotate': annotate,
+ 'copy': copy,
+ 'extend': extend,
+ 'equals': equals,
+ 'forEach': forEach,
+ 'injector': createInjector,
+ 'noop':noop,
+ 'bind':bind,
+ 'toJson': toJson,
+ 'fromJson': fromJson,
+ 'identity':identity,
+ 'isUndefined': isUndefined,
+ 'isDefined': isDefined,
+ 'isString': isString,
+ 'isFunction': isFunction,
+ 'isObject': isObject,
+ 'isNumber': isNumber,
+ 'isArray': isArray,
+ 'version': version,
+ 'isDate': isDate,
+ 'lowercase': lowercase,
+ 'uppercase': uppercase
+ });
+}
+
/**
* @ngdoc property
diff --git a/src/AngularPublic.js b/src/AngularPublic.js
index 3ed0eab7..600f1ef8 100644
--- a/src/AngularPublic.js
+++ b/src/AngularPublic.js
@@ -11,31 +11,7 @@ angularService('$browser', function($log, $sniffer) {
}, {$inject: ['$log', '$sniffer']});
-extend(angular, {
- // disabled for now until we agree on public name
- //'annotate': annotate,
- 'copy': copy,
- 'extend': extend,
- 'equals': equals,
- 'forEach': forEach,
- 'injector': createInjector,
- 'noop':noop,
- 'bind':bind,
- 'toJson': toJson,
- 'fromJson': fromJson,
- 'identity':identity,
- 'isUndefined': isUndefined,
- 'isDefined': isDefined,
- 'isString': isString,
- 'isFunction': isFunction,
- 'isObject': isObject,
- 'isNumber': isNumber,
- 'isArray': isArray,
- 'version': version,
- 'isDate': isDate,
- 'lowercase': lowercase,
- 'uppercase': uppercase
-});
+publishExternalAPI(angular);
//try to bind to jquery now so that one can write angular.element().read()
//but we will rebind on bootstrap again.
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 154db7d0..b5949623 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -46,7 +46,9 @@ function dumpScope(scope, offset) {
return log.join('\n' + offset);
}
+publishExternalAPI(angular)
beforeEach(function() {
+ publishExternalAPI(angular)
// This is to reset parsers global cache of expressions.
compileCache = {};
@@ -80,7 +82,6 @@ beforeEach(function() {
$logMock.info.logs = [];
$logMock.error.logs = [];
- resetAngularPublic()
});
function inject(){
@@ -118,34 +119,6 @@ function inject(){
};
}
-/**
- * This method republishes the public angular API. It should probably be cleaned up somehow.
- * //TODO: remove this method and merge it with the angularPublic.js class
- */
-function resetAngularPublic() {
- extend(angular, {
- 'element': jqLite,
- 'copy': copy,
- 'extend': extend,
- 'equals': equals,
- 'forEach': forEach,
- 'noop': noop,
- 'bind': bind,
- 'toJson': toJson,
- 'fromJson': fromJson,
- 'identity':identity,
- 'injector': createInjector,
- 'isUndefined': isUndefined,
- 'isDefined': isDefined,
- 'isString': isString,
- 'isFunction': isFunction,
- 'isObject': isObject,
- 'isNumber': isNumber,
- 'isArray': isArray
- });
-}
-
-resetAngularPublic();
afterEach(inject(function($rootScope) {
// release the injector