export class ViewMetadata
export class ViewMetadata
exported from angular2/core defined in angular2/src/core/metadata/view.ts (line 32)
Metadata properties available for configuring Views.
Each Angular component requires a single @Component
and at least one @View
annotation. The
@View
annotation specifies the HTML template to use, and lists the directives that are active
within the template.
When a component is instantiated, the template is loaded into the component's shadow root, and the expressions and statements in the template are evaluated against the component.
For details on the @Component
annotation, see ComponentMetadata
.
Example
Constructor
constructor({templateUrl, template, directives, pipes, encapsulation, styles, styleUrls}?: {
templateUrl?: string,
template?: string,
directives?: Array<Type | any[]>,
pipes?: Array<Type | any[]>,
encapsulation?: ViewEncapsulation,
styles?: string[],
styleUrls?: string[],
})
constructor({templateUrl, template, directives, pipes, encapsulation, styles, styleUrls}?: {
templateUrl?: string,
template?: string,
directives?: Array<Type | any[]>,
pipes?: Array<Type | any[]>,
encapsulation?: ViewEncapsulation,
styles?: string[],
styleUrls?: string[],
})
Not Yet Documented
Members
templateUrl : string
templateUrl : string
Specifies a template URL for an Angular component.
NOTE: Only one of templateUrl
or template
can be defined per View.
template : string
template : string
Specifies an inline template for an Angular component.
NOTE: Only one of templateUrl
or template
can be defined per View.
styleUrls : string[]
styleUrls : string[]
Specifies stylesheet URLs for an Angular component.
styles : string[]
styles : string[]
Specifies an inline stylesheet for an Angular component.
directives : Array<Type | any[]>
directives : Array<Type | any[]>
Specifies a list of directives that can be used within a template.
Directives must be listed explicitly to provide proper component encapsulation.
#
pipes : Array<Type | any[]>
pipes : Array<Type | any[]>
Not Yet Documented
encapsulation : ViewEncapsulation
encapsulation : ViewEncapsulation
Specify how the template and the styles should be encapsulated.
The default is ViewEncapsulation.Emulated
if the view
has styles,
otherwise ViewEncapsulation.None
.