mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-03-29 16:58:56 +08:00
feat(scenario): expose jQuery for usage outside of angular scenario
The global jQuery reference is removed by angular scenario and only a local scoped reference is kept. To make jQuery available for other code, a new reference angular.scenario.jQuery is added.
This commit is contained in:
committed by
Jeff Cross
parent
ca3e0c8ce5
commit
3fdbe81a33
@@ -9,6 +9,11 @@
|
||||
// Public namespace
|
||||
angular.scenario = angular.scenario || {};
|
||||
|
||||
/**
|
||||
* Expose jQuery (e.g. for custom dsl extensions).
|
||||
*/
|
||||
angular.scenario.jQuery = _jQuery;
|
||||
|
||||
/**
|
||||
* Defines a new output format.
|
||||
*
|
||||
|
||||
@@ -29,4 +29,16 @@ describe("ScenarioSpec: Compilation", function() {
|
||||
expect(jqLite(element).text()).toEqual('123');
|
||||
}));
|
||||
});
|
||||
|
||||
describe('jQuery', function () {
|
||||
it('should exist on the angular.scenario object', function () {
|
||||
expect(angular.scenario.jQuery).toBeDefined();
|
||||
});
|
||||
|
||||
it('should have common jQuery methods', function () {
|
||||
var jQuery = angular.scenario.jQuery;
|
||||
expect(typeof jQuery).toEqual('function');
|
||||
expect(typeof jQuery('<div></div>').html).toEqual('function');
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user