feat(core): view engine - integrate with ComponentFactory
(#14237)
`ComponentFactory`s can now be created from a `ViewDefinitionFactory` via `RefFactory.createComponentFactory`. This commit also: - splits `Services` into `Refs` and `RootData` - changes `ViewState` into a bitmask - implements `ViewContainerRef.move` Part of #14013 PR Close #14237
This commit is contained in:

committed by
Miško Hevery

parent
388afa414e
commit
14d7844b2b
@ -6,8 +6,8 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {RootRenderer} from '@angular/core';
|
||||
import {checkNodeDynamic, checkNodeInline} from '@angular/core/src/view/index';
|
||||
import {Injector, RootRenderer, Sanitizer} from '@angular/core';
|
||||
import {RootData, checkNodeDynamic, checkNodeInline} from '@angular/core/src/view/index';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
|
||||
@ -51,3 +51,19 @@ export function checkNodeInlineOrDynamic(inlineDynamic: InlineDynamic, values: a
|
||||
return checkNodeDynamic(values);
|
||||
}
|
||||
}
|
||||
|
||||
export function createRootData(projectableNodes?: any[][], rootSelectorOrNode?: any): RootData {
|
||||
const injector = TestBed.get(Injector);
|
||||
const renderer = injector.get(RootRenderer);
|
||||
const sanitizer = injector.get(Sanitizer);
|
||||
projectableNodes = projectableNodes || [];
|
||||
return <RootData>{
|
||||
injector,
|
||||
projectableNodes,
|
||||
selectorOrNode: rootSelectorOrNode, sanitizer, renderer
|
||||
};
|
||||
}
|
||||
|
||||
export let removeNodes: Node[];
|
||||
beforeEach(() => { removeNodes = []; });
|
||||
afterEach(() => { removeNodes.forEach((node) => getDOM().remove(node)); });
|
||||
|
Reference in New Issue
Block a user