createHostComponentMeta function
CompileDirectiveMetadata
createHostComponentMeta(
- CompileTypeMetadata componentType,
- String componentSelector,
- AnalyzedClass? analyzedClass,
- bool? preserveWhitespace,
Construct CompileDirectiveMetadata from ComponentTypeMetadata
and a
selector.
Implementation
CompileDirectiveMetadata createHostComponentMeta(
CompileTypeMetadata componentType,
String componentSelector,
AnalyzedClass? analyzedClass,
bool? preserveWhitespace) {
var template =
CssSelector.parse(componentSelector)[0].getMatchingElementTemplate();
return CompileDirectiveMetadata(
originType: componentType,
type: CompileTypeMetadata(
name: '${componentType.name}Host',
moduleUrl: componentType.moduleUrl,
isHost: true),
template: CompileTemplateMetadata(
template: template,
templateUrl: '${componentType.moduleUrl}/host/$componentSelector',
preserveWhitespace: preserveWhitespace,
styles: const [],
styleUrls: const [],
ngContentSelectors: const []),
changeDetection: ChangeDetectionStrategy.Default,
analyzedClass: analyzedClass,
inputs: const {},
inputTypes: const {},
outputs: const {},
hostBindings: const {},
hostListeners: const {},
metadataType: CompileDirectiveMetadataType.Component,
selector: '*',
);
}