feat(core): more read options for ngIvy queries (#21187)

PR Close #21187
This commit is contained in:
Pawel Kozlowski
2017-12-19 16:51:42 +01:00
committed by Miško Hevery
parent c516bc3b35
commit a62371c0eb
7 changed files with 221 additions and 24 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ComponentTemplate, ComponentType, PublicFeature, defineComponent, renderComponent as _renderComponent} from '../../src/render3/index';
import {ComponentTemplate, ComponentType, DirectiveType, PublicFeature, defineComponent, defineDirective, renderComponent as _renderComponent} from '../../src/render3/index';
import {NG_HOST_SYMBOL, createLNode, createViewState, renderTemplate} from '../../src/render3/instructions';
import {LElement, LNodeFlags} from '../../src/render3/interfaces';
import {RElement, RText, Renderer3, RendererFactory3, domRendererFactory3} from '../../src/render3/renderer';
@ -80,6 +80,14 @@ export function createComponent(
};
}
export function createDirective(): DirectiveType<any> {
return class Directive {
static ngDirectiveDef = defineDirective({
type: Directive,
factory: () => new Directive(),
});
};
}
// Verify that DOM is a type of render. This is here for error checking only and has no use.