• Overview
@angular/core

viewChild

Initializer API

Initializes a view child query.

Consider using viewChild.required for queries that should always match.

  
    
  
  
function viewChild<LocatorT, ReadT>(locator: string | ProviderToken<LocatorT>, opts: { read: ProviderToken<ReadT>; debugName?: string | undefined; }): Signal<ReadT | undefined>;

Initializes a view child query. Consider using viewChild.required for queries that should always match.

@paramlocatorstring | ProviderToken<LocatorT>
@paramopts{ read: ProviderToken<ReadT>; debugName?: string | undefined; }
@returnsSignal<ReadT | undefined>
function viewChild<LocatorT>(locator: string | ProviderToken<LocatorT>, opts?: { debugName?: string | undefined; } | undefined): Signal<LocatorT | undefined>;
@paramlocatorstring | ProviderToken<LocatorT>
@paramopts{ debugName?: string | undefined; } | undefined
@returnsSignal<LocatorT | undefined>
function viewChild.required<LocatorT>(locator: string | ProviderToken<LocatorT>, opts?: { debugName?: string | undefined; } | undefined): Signal<LocatorT>;
@paramlocatorstring | ProviderToken<LocatorT>
@paramopts{ debugName?: string | undefined; } | undefined
@returnsSignal<LocatorT>
function viewChild.required<LocatorT, ReadT>(locator: string | ProviderToken<LocatorT>, opts: { read: ProviderToken<ReadT>; debugName?: string | undefined; }): Signal<ReadT>;
@paramlocatorstring | ProviderToken<LocatorT>
@paramopts{ read: ProviderToken<ReadT>; debugName?: string | undefined; }
@returnsSignal<ReadT>
Jump to details