Represents an Angular View.

A View is a fundamental building block of the application UI. It is the smallest grouping of Elements which are created and destroyed together.

Properties of elements in a View can change, but the structure (number and order) of elements in a View cannot. Changing the structure of Elements can only be done by inserting, moving or removing nested Views via a ViewContainerRef. Each View can contain many View Containers.

Example

Given this template...

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

... we have two [ProtoViewRef]s:

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

Inner [ProtoViewRef]:
  <li>{{item}}</li>

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

The outer/inner ProtoViewRefs are then assembled into views like so:

Count: 2

  • first
  • second
Inheritance

Constructors

EmbeddedViewRef()

Properties

rootNodes → List
read-only
destroyed → bool
read-only, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

destroy() → void
Destroys the view and all of the data structures associated with it.
hasLocal(String variableName) → bool
Checks whether this view has a local variable called variableName.
markForCheck() → void
Marks the node for change detection.
setLocal(String variableName, value) → void
Sets value of local variable called variableName in this View.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onDestroy(OnDestroyCallback callback) → void
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(other) → bool
The equality operator. [...]
inherited