mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 03:30:02 +08:00
feat($rootElement): added application root element
Publish the application root element as $rootElement so that it can be injected to other services.
This commit is contained in:
12
test/ng/rootElementSpec.js
Normal file
12
test/ng/rootElementSpec.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
describe('$rootElement', function() {
|
||||
it('should publish the bootstrap element into $rootElement', function() {
|
||||
var element = jqLite('<div></div>');
|
||||
var injector = angular.bootstrap(element);
|
||||
|
||||
expect(injector.get('$rootElement')[0]).toBe(element[0]);
|
||||
|
||||
dealoc(element);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user