feat(UpgradeComponent): add support for require
This commit also adds/improves/fixes some `UpgradeComponent` tests.
This commit is contained in:

committed by
vikerman

parent
469010ea8e
commit
fe1d0e29c5
@ -7,6 +7,7 @@
|
||||
*/
|
||||
import {PlatformRef, Type} from '@angular/core';
|
||||
import * as angular from '@angular/upgrade/src/angular_js';
|
||||
import {$ROOT_SCOPE} from '@angular/upgrade/src/aot/constants';
|
||||
import {UpgradeModule} from '@angular/upgrade/static';
|
||||
|
||||
export function bootstrap(
|
||||
@ -20,6 +21,11 @@ export function bootstrap(
|
||||
});
|
||||
}
|
||||
|
||||
export function digest(adapter: UpgradeModule) {
|
||||
const $rootScope = adapter.$injector.get($ROOT_SCOPE) as angular.IRootScopeService;
|
||||
$rootScope.$digest();
|
||||
}
|
||||
|
||||
export function html(html: string): Element {
|
||||
// Don't return `body` itself, because using it as a `$rootElement` for ng1
|
||||
// will attach `$injector` to it and that will affect subsequent tests.
|
||||
|
Reference in New Issue
Block a user