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:
Andreas Marek 2013-07-24 21:20:39 +02:00 committed by Jeff Cross
parent ca3e0c8ce5
commit 3fdbe81a33
2 changed files with 17 additions and 0 deletions

View file

@ -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.
*

View file

@ -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');
})
});
});