NgForIdentity<T> class

An alternative to NgFor optimized for immutable/unmodified collections.

<ng-container *ngForIdentity="let e of list">
  Hello {{e}}!
</ng-container>

Unlike NgFor, NgForIdentity:

  • Uses identity not contents of a collection to build child views.
  • Assumes all collections' contents will never change.
  • Only supports the $implicit and index local variables.

This API is experimental and subject to change or removal.

Annotations
  • @Directive(selector: '[ngForIdentity][ngForIdentityOf]')
  • @experimental

Constructors

NgForIdentity(TemplateRef _template, ViewContainerRef _container)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
ngForIdentityOf Iterable<T>?
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited