ProtoViewRef

export class ProtoViewRef

exported from angular2/core defined in angular2/src/core/linker/view_ref.ts (line 129)

Represents an Angular ProtoView.

A ProtoView is a prototypical View that is the result of Template compilation and is used by Angular to efficiently create an instance of this View based on the compiled Template.

Most ProtoViews are created and used internally by Angular and you don't need to know about them, except in advanced use-cases where you compile components yourself via the low-level Compiler API.

Example

Given this template:

Count: {{items.length}} <ul> <li *ngFor="var item of items">{{item}}</li> </ul>

Angular desugars and compiles the template into two ProtoViews:

Outer ProtoView:

Count: {{items.length}} <ul> <template ngFor var-item [ngForOf]="items"></template> </ul>

Inner ProtoView:

<li>{{item}}</li>

Notice that the original template is broken down into two separate ProtoViews.