ngOnInit method

  1. @override
void ngOnInit()

Executed after the first change detection run for a directive.

See OnInit for a full description.

Implementation

@override
void ngOnInit() {
  // We only focus on the relevant button when the expanded state is changed
  // by user action.
  _disposer.addStreamSubscription(isExpandedChangeByUserAction.listen((_) {
    // Wait for the button reference to be set after change detection is done
    // and buttonDirective is created.
    _ngZone.onEventDone.first.then(([_]) {
      _expandCollapseButton?.focus();
    });
  }));
  initialized = true;
}