Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
chore(AngularPublic): remove angular.noConflict feature
Browse files Browse the repository at this point in the history
  • Loading branch information
matsko authored and mhevery committed Jun 7, 2013
1 parent 65f5e85 commit 9faabd1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 42 deletions.
18 changes: 0 additions & 18 deletions src/Angular.js
Expand Up @@ -63,24 +63,6 @@ var /** holds major version number for IE or NaN for real browsers */
nodeName_,
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
* @param {*} obj
Expand Down
3 changes: 1 addition & 2 deletions src/AngularPublic.js
Expand Up @@ -48,8 +48,7 @@ function publishExternalAPI(angular){
'isDate': isDate,
'lowercase': lowercase,
'uppercase': uppercase,
'callbacks': {counter: 0},
'noConflict': noConflict
'callbacks': {counter: 0}
});

angularModule = setupModuleLoader(window);
Expand Down
22 changes: 0 additions & 22 deletions test/AngularSpec.js
Expand Up @@ -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();
});

});

});

1 comment on commit 9faabd1

@snostorm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, for those curious, #2893 gives some clues as to why this was removed and notes that in the future they're open to including a (working) noConflict option again

Please sign in to comment.