mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-28 23:28:16 +00: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:
parent
ca3e0c8ce5
commit
3fdbe81a33
2 changed files with 17 additions and 0 deletions
|
|
@ -9,6 +9,11 @@
|
||||||
// Public namespace
|
// Public namespace
|
||||||
angular.scenario = angular.scenario || {};
|
angular.scenario = angular.scenario || {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expose jQuery (e.g. for custom dsl extensions).
|
||||||
|
*/
|
||||||
|
angular.scenario.jQuery = _jQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a new output format.
|
* Defines a new output format.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,16 @@ describe("ScenarioSpec: Compilation", function() {
|
||||||
expect(jqLite(element).text()).toEqual('123');
|
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');
|
||||||
|
})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue