refactor(ivy): move directive into elementStart (#21374)
We used to have a separate `directive` instruction for instantiating directives. However, such an instruction requires that directives are created in the correct order, which would require that template compiler would have knowledge of all dependent directives. This would break template compilation locality principle. This change only changes the APIs to expected form but does not change the semantics. The semantics will need to be corrected in subsequent commits. The semantic change needed is to resolve the directive instantiation error at runtime based on injection dependencies. PR Close #21374
This commit is contained in:
@ -57,6 +57,11 @@ export interface DirectiveDef<T> {
|
||||
*/
|
||||
methods: {[P in keyof T]: P};
|
||||
|
||||
/**
|
||||
* Name under which the directive is exported (for use with local references in template)
|
||||
*/
|
||||
exportAs: string|null;
|
||||
|
||||
/**
|
||||
* factory function used to create a new directive instance.
|
||||
*
|
||||
@ -131,6 +136,7 @@ export interface DirectiveDefArgs<T> {
|
||||
outputs?: {[P in keyof T]?: string};
|
||||
methods?: {[P in keyof T]?: string};
|
||||
features?: DirectiveDefFeature[];
|
||||
exportAs?: string;
|
||||
}
|
||||
|
||||
export interface ComponentDefArgs<T> extends DirectiveDefArgs<T> {
|
||||
|
Reference in New Issue
Block a user