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

Commit 3fdbe81

Browse files
andimarekjeffbcross
authored andcommittedJul 31, 2013
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.
1 parent ca3e0c8 commit 3fdbe81

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
 

‎src/ngScenario/Scenario.js

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
// Public namespace
1010
angular.scenario = angular.scenario || {};
1111

12+
/**
13+
* Expose jQuery (e.g. for custom dsl extensions).
14+
*/
15+
angular.scenario.jQuery = _jQuery;
16+
1217
/**
1318
* Defines a new output format.
1419
*

‎test/ngScenario/ScenarioSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,16 @@ describe("ScenarioSpec: Compilation", function() {
2929
expect(jqLite(element).text()).toEqual('123');
3030
}));
3131
});
32+
33+
describe('jQuery', function () {
34+
it('should exist on the angular.scenario object', function () {
35+
expect(angular.scenario.jQuery).toBeDefined();
36+
});
37+
38+
it('should have common jQuery methods', function () {
39+
var jQuery = angular.scenario.jQuery;
40+
expect(typeof jQuery).toEqual('function');
41+
expect(typeof jQuery('<div></div>').html).toEqual('function');
42+
})
43+
});
3244
});

0 commit comments

Comments
 (0)