Configures a content query.

Content queries are set before the ngAfterContentInit callback is called.

Example

@Directive(selector: 'someDir')
class SomeDir implements AfterContentInit {
  @ContentChildren(ChildDirective)
  QueryList<ChildDirective> contentChildren;

  @override
  ngAfterContentInit() {
    // contentChildren is set
  }
}
Inheritance
  • Object
  • ContentChildren

Constructors

ContentChildren(Object selector, { bool descendants: false, Object read })
const

Properties

descendants → bool
Whether to query only direct children (false) or all children (true).
final, inherited
first → bool
Whether to only query the first child.
final, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
read → Object
The DI token to read from an element that matches the selector.
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
selector → Object
Either the class Type or selector String.
final, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

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