Home Reference Source Repository
import {DirectiveSymbol} from 'ngast/dist-docs/lib/directive-symbol.js'
public class | source

DirectiveSymbol

Extends:

Symbol → DirectiveSymbol

This class represents the individual directives and wrapps their StaticSymbols produced by the @angular/compiler.

Constructor Summary

Public Constructor
public

constructor(program: Program, symbol: StaticSymbol, metadataResolver: CompileMetadataResolver, directiveNormalizer: DirectiveNormalizer, resolver: DirectiveResolver, reflector: StaticReflector, resourceResolver: ResourceResolver, projectSymbols: ContextSymbols)

Creates an instance of DirectiveSymbol.

Method Summary

Public Methods
public

getDirectiveContext(): DirectiveContext

Returns the context into which the template of given component is going to be compiled.

public

getModule(): CompileNgModuleMetadata | undefined

Returns the module where the given directive has been declared.

public

getNonResolvedMetadata(): CompileDirectiveMetadata

Returns the non-resolved metadata for given directive.

public

getResolvedMetadata(): CompileTemplateMetadata

Returns the normalized and resolved metadata for given directive or component.

public

getStyleAsts(): CssAst[]

Returns the ASTs of all styles of the target directive.

public

getTemplateAst(): TemplateAstResult

Returns the compiled template of the target component.

public

Returns if the target directive is a component.

Inherited Summary

From class Symbol
public get

symbol: *

The wrapped StaticSymbol from @angular/compiler.

public

getNode(): ts.ClassDeclaration | undefined

Gets the ts.node which corresponds to the controller of the DirectiveSymbol or the implementation of the pipe.

Public Constructors

public constructor(program: Program, symbol: StaticSymbol, metadataResolver: CompileMetadataResolver, directiveNormalizer: DirectiveNormalizer, resolver: DirectiveResolver, reflector: StaticReflector, resourceResolver: ResourceResolver, projectSymbols: ContextSymbols) source

Creates an instance of DirectiveSymbol.

Override:

Symbol#constructor

Params:

NameTypeAttributeDescription
program Program
symbol StaticSymbol
metadataResolver CompileMetadataResolver
directiveNormalizer DirectiveNormalizer
resolver DirectiveResolver
reflector StaticReflector
resourceResolver ResourceResolver
projectSymbols ContextSymbols

Public Methods

public getDirectiveContext(): DirectiveContext source

Returns the context into which the template of given component is going to be compiled.

Return:

DirectiveContext

public getModule(): CompileNgModuleMetadata | undefined source

Returns the module where the given directive has been declared.

Return:

CompileNgModuleMetadata | undefined

public getNonResolvedMetadata(): CompileDirectiveMetadata source

Returns the non-resolved metadata for given directive. If it is a component, this means that the external templates and styles won't be read from the drive. Also, the paths to external metadata won't be resolved.

Return:

CompileDirectiveMetadata

public getResolvedMetadata(): CompileTemplateMetadata source

Returns the normalized and resolved metadata for given directive or component. For components, all the external templates and styles will be read and set as values of the returned CompileTemplateMetadata properties.

Return:

CompileTemplateMetadata

public getStyleAsts(): CssAst[] source

Returns the ASTs of all styles of the target directive.

Return:

CssAst[]

public getTemplateAst(): TemplateAstResult source

Returns the compiled template of the target component.

Return:

TemplateAstResult

public isComponent(): boolean source

Returns if the target directive is a component.

Return:

boolean