mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-10 07:44:43 +00:00
chore(AngularPublic): remove angular.noConflict feature
This commit is contained in:
parent
65f5e856a1
commit
9faabd1ba0
3 changed files with 1 additions and 42 deletions
|
|
@ -63,24 +63,6 @@ var /** holds major version number for IE or NaN for real browsers */
|
||||||
nodeName_,
|
nodeName_,
|
||||||
uid = ['0', '0', '0'];
|
uid = ['0', '0', '0'];
|
||||||
|
|
||||||
/**
|
|
||||||
* @ngdoc function
|
|
||||||
* @name angular.noConflict
|
|
||||||
* @function
|
|
||||||
*
|
|
||||||
* @description
|
|
||||||
* Restores the previous global value of angular and returns the current instance. Other libraries may already use the
|
|
||||||
* angular namespace. Or a previous version of angular is already loaded on the page. In these cases you may want to
|
|
||||||
* restore the previous namespace and keep a reference to angular.
|
|
||||||
*
|
|
||||||
* @return {Object} The current angular namespace
|
|
||||||
*/
|
|
||||||
function noConflict() {
|
|
||||||
var a = window.angular;
|
|
||||||
window.angular = _angular;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {*} obj
|
* @param {*} obj
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@ function publishExternalAPI(angular){
|
||||||
'isDate': isDate,
|
'isDate': isDate,
|
||||||
'lowercase': lowercase,
|
'lowercase': lowercase,
|
||||||
'uppercase': uppercase,
|
'uppercase': uppercase,
|
||||||
'callbacks': {counter: 0},
|
'callbacks': {counter: 0}
|
||||||
'noConflict': noConflict
|
|
||||||
});
|
});
|
||||||
|
|
||||||
angularModule = setupModuleLoader(window);
|
angularModule = setupModuleLoader(window);
|
||||||
|
|
|
||||||
|
|
@ -877,26 +877,4 @@ describe('angular', function() {
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('noConflict', function() {
|
|
||||||
var globalAngular;
|
|
||||||
beforeEach(function() {
|
|
||||||
globalAngular = angular;
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(function() {
|
|
||||||
angular = globalAngular;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return angular', function() {
|
|
||||||
var a = angular.noConflict();
|
|
||||||
expect(a).toBe(globalAngular);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should restore original angular', function() {
|
|
||||||
var a = angular.noConflict();
|
|
||||||
expect(angular).toBeUndefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue